Skip to content

fix: [branch-1.1] fall back for rank limits over nested float keys (#6468) - #6487

Open
andygrove wants to merge 1 commit into
apache:branch-1.1from
andygrove:backport-6468-branch-1.1
Open

andygrove wants to merge 1 commit into
apache:branch-1.1from
andygrove:backport-6468-branch-1.1

Conversation

@andygrove

Copy link
Copy Markdown
Member

Which issue does this PR close?

Refs #5507 and #6402. Backport of merged #6468 (source c312b1c; main merge 300c748).

Rationale for this change

RC1's native RANK/DENSE_RANK cutoff can drop tied rows when order keys contain nested -0.0/+0.0 or NaN. Restore Spark's correct results for RC2 by falling back for these keys.

What changes are included in this PR?

Cherry-pick #6468 onto branch-1.1: the nested-floating-point fallback, compatibility documentation, and regression coverage. ROW_NUMBER and supported scalar-key paths keep their existing behavior. The cherry-pick applied without conflicts.

How are these changes tested?

On branch-1.1 with this patch, a fresh cargo build --offline passed. JDK 17/default Spark 4.1: ./mvnw -o -B test -Dtest=none '-Dsuites=org.apache.comet.exec.CometWindowExecSuite floating-point values nested' passed (one selected test exercising the query matrix). git diff --check passed. Other Spark profiles and the full Spark SQL suite were not run locally; release-branch CI is pending.

…oating-point keys

The native WindowGroupLimit finds RANK and DENSE_RANK ties by comparing
row-encoded ORDER BY keys byte for byte. Scalar float keys are normalized
first, but a float nested in an array or struct keeps its raw bits, so
[-0.0] and [0.0] got different ranks and the cutoff dropped rows that Spark
keeps as ties. In 1.0.0 the limit ran in Spark, so this is a regression in
1.1.0.

Fall back for RANK and DENSE_RANK when an order key contains a nested
FLOAT or DOUBLE. ROW_NUMBER never compares peers and stays native, and
Spark already normalizes floating-point partition keys.

Part of apache#5507.

(cherry picked from commit c312b1c)
@github-actions github-actions Bot added the bug Something isn't working label Oct 1, 2026
@andygrove
andygrove marked this pull request as ready for review October 1, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant