Skip to content

Conversation

@rajarshisarkar
Copy link
Contributor

@rajarshisarkar rajarshisarkar commented Mar 23, 2022

This PR introduces ordering of RewriteFileGroup. This should be helpful in cases where we want to force the compaction order according to the size (in bytes) or number of files.

Introduce a new Spark option rewrite.job-order = {"bytes-asc", "bytes-desc", "files-asc", "files-desc", "none"}.

  • rewrite.job-order=bytes-asc: rewrite the smallest job groups first.
  • rewrite.job-order=bytes-desc: rewrite the largest job groups first.
  • rewrite.job-order=files-asc: rewrite the job groups with the least files first.
  • rewrite.job-order=files-desc: rewrite the job groups with the most files first.
  • rewrite.job-order=none: rewrite job groups in the order they were planned (no specific ordering).

cc: @RussellSpitzer

@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch 6 times, most recently from 4de2828 to 34b70ca Compare March 28, 2022 12:21
@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch 2 times, most recently from de8118f to d21536c Compare March 29, 2022 11:06
@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch 3 times, most recently from 6f9858e to 067c849 Compare March 31, 2022 09:35
@rajarshisarkar rajarshisarkar marked this pull request as ready for review March 31, 2022 12:10
Copy link
Member

@RussellSpitzer RussellSpitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some notes on Enum usage, we can remove some of the if statements by
using built in functions and switch statements.

Tests can probably be simplified a bit to just check the task ordering.

Other than that I think we are general good to go

@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch 2 times, most recently from 6ed30e1 to 9508eef Compare April 7, 2022 09:18
@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch 2 times, most recently from 2c3e1cf to 2d7197f Compare April 12, 2022 08:32
@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch from 2d7197f to 84658a6 Compare April 13, 2022 06:57
@rajarshisarkar
Copy link
Contributor Author

@RussellSpitzer PR is ready for another round of review.

@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch 3 times, most recently from 24ba231 to 5f4803e Compare April 15, 2022 15:39
@rajarshisarkar rajarshisarkar force-pushed the rewrite-data-files-order branch from 5f4803e to efc59b7 Compare April 15, 2022 16:29
@RussellSpitzer RussellSpitzer merged commit d1476c6 into apache:master Apr 15, 2022
@RussellSpitzer
Copy link
Member

Thanks for the patch @rajarshisarkar , Let's do a quick followup to move the changes into 3.0 and 3.1

sunchao pushed a commit to sunchao/iceberg that referenced this pull request May 9, 2023
)

Allows users to specify the order in which Rewrite JobGroups should be executed.

(cherry picked from commit d1476c6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants