Skip to content

feat: support native wide-decimal hashing - #6548

Merged
andygrove merged 12 commits into
apache:mainfrom
rich7420:feat/5994-native-wide-decimal-hash
Oct 20, 2026
Merged

andygrove merged 12 commits into
apache:mainfrom
rich7420:feat/5994-native-wide-decimal-hash

Conversation

@rich7420

@rich7420 rich7420 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #5994.

Rationale for this change

Native wide-decimal hashing used different bytes from Spark, so mixed native/JVM shuffle could lose matching join rows. Make precision 19–38 hashing Spark-compatible and enable native SQL hash/xxhash64.

What changes are included in this PR?

  • Encode unscaled values as minimal signed big-endian bytes and optimize decimal-list hashing. Precision at most 18 is unchanged; retain Comet's wide-decimal xxhash64 kernel because the pinned upstream kernel differs.
  • Remove wide-decimal guards from typed Dataset and shuffle-input conversion, enabling native shuffle for eligible inputs while retaining metadata-sensitive restrictions.
  • Add scalar/nested NULL, signed-byte, partition-parity, mixed-shuffle and AQE coverage, benchmarks and support documentation.

How are these changes tested?

At 33682c0ee, upstream CI passed, including Rust, native build, lint, Spark 4.1 suites and TPC-H/TPC-DS. The merge includes #6740's Spark 4.2 timestamp fix; hashing code is unchanged from 8b1d26a32. Supplemental Spark SQL and cross-profile CI: requested via fork #35, but fork Actions is blocked and no current-head run started. Please apply run-spark-4.1-tests and run-all-spark-profiles upstream before queueing.

Historical fork CI covered Spark 4.1 SQL and mixed shuffle on Spark 4.1/4.2; its Spark 4.2 expression failure predates the main update and is not a current-head verdict.

Historical benchmarks at 27faa50ed measured 5.0–14.2x Murmur3 and 2.1–15.8x xxhash64 improvements over the pre-optimization native decimal-array path. Whole-query native array hashing averaged 83–89 ms versus 159–176 ms with Spark hash fallback. These local measurements were not rerun for this merge. Benchmark source.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:aggregation Hash aggregates, aggregate expressions area:expressions Expression evaluation area:shuffle Shuffle (JVM and native) enhancement New feature or request run-all-spark-profiles Run the Comet test suites against every Spark profile on this pull request, ahead of the merge queue run-spark-4.1-tests Run the Spark 4.1 SQL tests on this pull request instead of waiting for the merge queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Spark-compatible native hash and xxhash64 for decimals with precision >18

3 participants