Repository navigation
[spark] Plan sorted global index builds with one scan - #11482
Open
JustinBinber wants to merge 1 commit into
Open
JustinBinber wants to merge 1 commit into
JustinBinber wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fixes #11481.
A few table partitions can contain many disjoint RowID ranges. The identity-key sorted-index build currently constructs a separate Spark scan and projection for each range and combines them with Union. On the frozen fragmented fixture, combining the same branches with one Union still took 8.44 s before the first job.
Use one Spark scan over the existing range-filtered splits for Data Evolution builds with disjoint RowID ranges and query authorization disabled. Each row is assigned to the original build task by its RowID, with a literal task ID for single-range builds. The resulting task ID, index key and RowID feed the existing range shuffle, NULL compression and sorted writer. Other inputs use the per-range scan path.
Tests
Each measured build used two Paimon partitions and a private copy of the same snapshot for its fixture. The main fixture has 67 columns. Medians are from two fresh JVMs per arm and each layout was run in both orders. The baseline, bulk-Union and final one-scan runs used separate JVMs. The runs for each implementation exercised both layout orders. The dense control used ABBA order. Before-first-job time includes Paimon scan setup and Spark planning, and full build time includes index writes and snapshot commit.
The local timings characterize this fixture. Production and multi-node speedups have not been measured.