Liquid-clustering boundary sampling - #15925
Open
sdrp713 wants to merge 2 commits into
Open
Conversation
Contributor
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.
Fixes #15903 and fixes #15444
Description
Range-boundary sampling on very wide tables can create excessive GPU memory pressure and spill because the sampler carries payload columns that do not affect boundary calculation.
This PR optimizes GPU range-boundary sampling by reading only the columns required to calculate range keys, instead of materializing the complete input row.
The narrow boundary plan preserves deterministic filters and derived key dependencies. Unsupported plans and nondeterministic range expressions safely fall back to the existing full row path.
The collected boundaries are then applied to the original full row batches, so the final range partitioning and shuffle semantics remain unchanged.
Performance Results
The optimization was evaluated using a Delta Lake liquid-clustering workload consisting of:
OPTIMIZE FULLoperation on a table clustered by a column.The input contained:
The following configuration was used for both runs:
g4dn.8xlargeGPU executorsspark.sql.files.maxPartitionBytes=2gOnly the range-boundary collection implementation changed between the two runs.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance