fix: [branch-1.0] backport five bug fixes for 1.0.1 - #5480
Merged
andygrove merged 6 commits intoAug 26, 2026
Conversation
* feat: remove native cast from boolean to decimal Boolean -> Decimal is an edge case that nobody uses in practice, and the native implementation has to reproduce Spark's precision/scale and overflow semantics for it. That is not worth the complexity, so mark the cast unsupported in `CometCast` and let the `CodegenDispatchFallback` mixin route it through Spark's own generated code inside the Comet pipeline. The projection still runs natively; only the cast itself is evaluated by Spark's codegen. Adds SQL file tests covering non-ANSI and ANSI behavior, including the value-dependent overflow edge cases. * docs: link issue apache#5186 from the ignored boolean-to-decimal cast test Explain in the test comment that the ignore is a limitation of CometCastSuite rather than of the cast itself, and point at the tracking issue for re-enabling it. (cherry picked from commit ce602ac)
(cherry picked from commit bdd2e13)
…ith many partitions (apache#5392) * fix: Native shuffle fails with a 2GB task serialization OOM on jobs with very many partitions (cherry picked from commit 7e0e5d2)
Co-authored-by: Chao Sun <sunchao@apache.org> (cherry picked from commit e0ab0a6)
* chore: fix clippy warnings for Rust 1.98 * fix: keep Clippy allow backward-compatible (cherry picked from commit 92954d7)
sunchao
approved these changes
Aug 26, 2026
Member
Author
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.
Which issue does this PR close?
Backports five bug fixes from
maintobranch-1.0for the 1.0.1 patch release, plus one clippy chore needed to makebranch-1.0CI green at all. Closes #5334 onbranch-1.0.Rationale for this change
branch-1.0diverged frommainat #5240, and 79 commits have landed onmainsince. Four fixes were already backported in #5321. Of the remainingfix:commits, these five address correctness bugs or outright job failures that are present in 1.0.0, and none of them depend on post-1.0 features.Decimal128when10^scaledoes not fit the target precision.arrays_overlapcompares raw IEEE 754 bit patterns on flat float arrays, so Comet silently returns a different answer than Spark when aNaNis present.to_time/try_to_timedo not match Spark's whitespace trimming.make_daterejects years that Spark accepts.#5185 is titled
feat:onmainbecause it removes the native cast rather than repairing it, but it is the fix for a critical correctness bug and belongs in a patch release.What changes are included in this PR?
Six clean cherry-picks, in
mainorder, with original authorship and(cherry picked from commit ...)trailers preserved. No changes were needed to adapt any of them tobranch-1.0.Also included: #5400 (clippy for Rust 1.98)
The five bug fixes alone left CI red, and not because of the backports.
branch-1.0setsRUST_VERSION: stable, stable has since rolled to 1.98.0, and 1.98 added two lints that fire on code already on the branch:Neither file is touched by any of the five fixes, so this fails on any PR targeting
branch-1.0right now. #5400 fixed both onmainand was never backported, so it is included here as a sixth commit.Deliberately excluded
branch-1.0: its regression test referencesspill_accounted_input_buffers,repeated_spill_buffer_bytes, andmetrics.memory_spilled_bytes, all introduced by fix: report native shuffle write metrics accurately #5370. Backporting it would mean dragging fix: report native shuffle write metrics accurately #5370 along or rewriting the test.branch-1.0.enhancementupstream, not bug fixes.spark.comet.parquet.write.enableddefaults tofalseonbranch-1.0and is documented as highly experimental and not for production, so no 1.0.0 user is exposed.Still open for 1.0.1
Two milestoned correctness issues have no fix on
mainyet, so there is nothing to backport for them:to_time. The native parser still rejects'T12'and'12:30:45.', which Spark accepts.CometHashAggregateExecdoes not participate inAQEPropagateEmptyRelation.How are these changes tested?
Each fix carries its own regression tests, which came across with the cherry-picks. Verified locally on this branch:
cargo clippy --color=never --all-targets --workspace -- -D warnings— cleancargo fmt --all -- --check— cleancargo check --benches— cleancargo test -p datafusion-comet-spark-expr— 610 passedcargo test -p datafusion-comet-shuffle— 31 passed./mvnw test-compile— BUILD SUCCESS./mvnw spotless:check scalastyle:check— clean for the parent,comet-common, andcomet-sparkmodulesCometSqlFileTestSuite— 436 passed, covering all six new/changed.sqlfixturesCometCastSuite— 168 passed, 8 ignoredCometArrayExpressionSuite— 46 passedCometNativeShuffleSuite— 28 passedCometNativeShuffleInputRDDSuite— 1 passed