Repository navigation
[CELEBORN-2575] Fix Spark SQL data size for columnar shuffle - #3992
Open
huangxiaopingRD wants to merge 1 commit into
Open
huangxiaopingRD wants to merge 1 commit into
huangxiaopingRD wants to merge 1 commit into
Conversation
huangxiaopingRD
force-pushed
the
codex/fix-columnar-shuffle-data-size
branch
from
November 20, 2026 10:53
6093ba0 to
755761d
Compare
This branch has not been deployed
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.
What changes were proposed in this pull request?
Count the input
UnsafeRowsizes in the Spark SQLdataSizemetric for the Spark 3, 3.5, and 4 columnar hash writers. Stop adding encoded batch lengths when full or remaining batches are flushed.Why are the changes needed?
Spark's
UnsafeRowSerializercounts the original row bytes, while the columnar writer currently counts the encoded columnar batch size. The same rows therefore produce different SQL statistics depending on the writer and encoding. For example, 100 integer rows of 16 bytes each produced adataSizeof 416 bytes instead of 1600 bytes in an isolated reproduction.JIRA: https://issues.apache.org/jira/browse/CELEBORN-2575
Does this PR resolve a correctness bug?
This fixes SQL metric accounting. An effect on real AQE decisions has not been measured.
Does this PR introduce any user-facing change?
The SQL
dataSizemetric follows the same row-size convention as Spark's row serializer.How was this patch tested?
UnsafeRowSerializerafter the fix. It covers two partitions, different row sizes, full and final partial batches, row-count and byte-size limits, and plain, codegen, and dictionary modes.ColumnarHashBasedShuffleWriterSuiteJpassed with JDK 8 (16 tests per profile).ColumnarHashBasedShuffleWriterSuiteJ(16 tests) passed with JDK 21 and-Dnet.bytebuddy.experimental=true. The JDK 21 build was run in a separate validation worktree with the existingTruthSelfEqualsError Prone check disabled to bypass an unrelated failure inReadDataSuiteJ; that configuration change is not part of this PR.git diff --checkpassed. The changed Spark 4 Java files are byte-identical to the formatted Spark 3.5 files; direct Spark 4 Spotless on JDK 21 failed because the project's Google Java Format 1.7 is incompatible with JDK 21.