Skip to content

fix: [branch-1.0] backport five bug fixes for 1.0.1 - #5480

Merged
andygrove merged 6 commits into
apache:branch-1.0from
andygrove:backport-fixes-1.0.1-branch-1.0
Aug 26, 2026
Merged

fix: [branch-1.0] backport five bug fixes for 1.0.1#5480
andygrove merged 6 commits into
apache:branch-1.0from
andygrove:backport-fixes-1.0.1-branch-1.0

Conversation

@andygrove

@andygrove andygrove commented Aug 26, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Backports five bug fixes from main to branch-1.0 for the 1.0.1 patch release, plus one clippy chore needed to make branch-1.0 CI green at all. Closes #5334 on branch-1.0.

Rationale for this change

branch-1.0 diverged from main at #5240, and 79 commits have landed on main since. Four fixes were already backported in #5321. Of the remaining fix: 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.

Backported Fixes Impact
#5185 #5334 (priority:critical) Boolean-to-decimal cast produces an invalid Decimal128 when 10^scale does not fit the target precision.
#5376 #5270 (priority:critical) arrays_overlap compares raw IEEE 754 bit patterns on flat float arrays, so Comet silently returns a different answer than Spark when a NaN is present.
#5364 Part of #5149 (priority:critical) to_time / try_to_time do not match Spark's whitespace trimming.
#5392 #5391 Native shuffle fails with a 2GB task serialization OOM on jobs with very many partitions.
#5443 #5208 Native make_date rejects years that Spark accepts.

#5185 is titled feat: on main because 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 main order, with original authorship and (cherry picked from commit ...) trailers preserved. No changes were needed to adapt any of them to branch-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.0 sets RUST_VERSION: stable, stable has since rolled to 1.98.0, and 1.98 added two lints that fire on code already on the branch:

error: using `chunks_exact` with a constant chunk size
  --> spark-expr/src/bloom_filter/spark_bit_array.rs:80:64
error: manual implementation of `isolate_lowest_one`
  --> spark-expr/src/nondetermenistic_funcs/internal/mersenne.rs:152:12

Neither file is touched by any of the five fixes, so this fails on any PR targeting branch-1.0 right now. #5400 fixed both on main and was never backported, so it is included here as a sixth commit.

Deliberately excluded

Still open for 1.0.1

Two milestoned correctness issues have no fix on main yet, so there is nothing to backport for them:

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 — clean
  • cargo fmt --all -- --check — clean
  • cargo check --benches — clean
  • cargo test -p datafusion-comet-spark-expr — 610 passed
  • cargo test -p datafusion-comet-shuffle — 31 passed
  • ./mvnw test-compile — BUILD SUCCESS
  • ./mvnw spotless:check scalastyle:check — clean for the parent, comet-common, and comet-spark modules
  • CometSqlFileTestSuite — 436 passed, covering all six new/changed .sql fixtures
  • CometCastSuite — 168 passed, 8 ignored
  • CometArrayExpressionSuite — 46 passed
  • CometNativeShuffleSuite — 28 passed
  • CometNativeShuffleInputRDDSuite — 1 passed

sunchao and others added 5 commits August 26, 2026 13:43
…he#5364)

* fix: match Spark whitespace trimming in to_time and try_to_time

* test: address to_time trim review feedback

(cherry picked from commit a74839c)
* 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)
…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)
@andygrove andygrove added this to the 1.0.1 milestone Aug 26, 2026
* chore: fix clippy warnings for Rust 1.98

* fix: keep Clippy allow backward-compatible

(cherry picked from commit 92954d7)

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andygrove

@andygrove
andygrove merged commit 008cd88 into apache:branch-1.0 Aug 26, 2026
68 checks passed
@andygrove
andygrove deleted the backport-fixes-1.0.1-branch-1.0 branch August 26, 2026 23:15
@andygrove

Copy link
Copy Markdown
Member Author

Merged. Thanks @comphead and @sunchao

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants