Skip to content

[CELEBORN-2570] Exclude row length prefixes from sort fast-write dataSize - #3987

Open
huangxiaopingRD wants to merge 1 commit into
apache:mainfrom
huangxiaopingRD:fix-sort-writer-data-size
Open

huangxiaopingRD wants to merge 1 commit into
apache:mainfrom
huangxiaopingRD:fix-sort-writer-data-size

Conversation

@huangxiaopingRD

@huangxiaopingRD huangxiaopingRD commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Count rowSize in the SQL dataSize metric in SortBasedShuffleWriter.fastWrite0. Add regression coverage comparing sort and hash writers with fast-write enabled and disabled, for both buffered and giant records.

Why are the changes needed?

The sort fast-write path currently includes the 4-byte row length prefix in SQL dataSize, while Spark's UnsafeRowSerializer and Celeborn's hash fast-write path count only row bytes. Three 16-byte rows therefore report 60 bytes instead of 48 bytes. The regression tests also verify that the serialized records still contain 60 bytes including the prefixes.

JIRA: https://issues.apache.org/jira/browse/CELEBORN-2570

Does this PR resolve a correctness bug?

  • Yes

This fixes SQL metric accounting. No effect on real AQE decisions has been measured.

Does this PR introduce any user-facing change?

  • Yes

The SQL dataSize metric for sort fast-write excludes row length prefixes, matching normal serialization and hash fast-write.

How was this patch tested?

  • Confirmed the regression tests fail before the fix: sort fast-write reports 60 bytes where 48 bytes are expected, for both buffered and giant records. Normal serialization and hash fast-write report 48 bytes.
  • mvn -B -ntp -Pspark-3.3 -pl client-spark/spark-3 -am test -Dtest=SortBasedShuffleWriterSuiteJ,HashBasedShuffleWriterSuiteJ -DwildcardSuites=none -DfailIfNoTests=false (JDK 17): all 29 tests passed (17 sort, 12 hash), including the new data-size comparisons.
  • Spotless checks and git diff --check passed.

@huangxiaopingRD
huangxiaopingRD force-pushed the fix-sort-writer-data-size branch from d603ac0 to 97e863a Compare November 20, 2026 10:53
@github-actions github-actions Bot removed the correctness Correctness bugfix label Nov 20, 2026

This branch has not been deployed

No deployments
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.

1 participant