feat: support floating-point ASOF equality keys - #24375
Draft
Xuanwo wants to merge 15 commits into
Draft
Conversation
Co-authored-by: Yongting You <2010youy01@gmail.com>
This was referenced Aug 14, 2026
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24375 +/- ##
==========================================
- Coverage 81.19% 81.17% -0.02%
==========================================
Files 1110 1112 +2
Lines 388618 390030 +1412
Branches 388618 390030 +1412
==========================================
+ Hits 315531 316601 +1070
- Misses 54507 54773 +266
- Partials 18580 18656 +76 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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?
Rationale for this change
The physical ASOF operator in #23828 rejects floating-point equality keys because
Arrow's total ordering distinguishes
-0.0from+0.0, while join equalitytreats them as equal. That mismatch can split one equality group during the
required input sort and make the forward-only ASOF scan choose the wrong row.
This follow-up keeps the independently mergeable physical operator conservative,
then adds complete Float16, Float32, and Float64 equality-key support as a
separate stack layer.
GitHub shows the cumulative stack because fork branches cannot be selected as
upstream PR bases. The isolated diff for this layer is:
Xuanwo/datafusion@xuanwo/asof-physical...xuanwo/asof-float-equality
What changes are included in this PR?
NormalizeFloatZeroExprthat maps-0.0to+0.0without changing other values.required sort order agrees with the existing join-key comparator.
expression round-trip correctly.
(-0.0, ts=10)followed by(+0.0, ts=1)must remain one group and selectts=1for a left(+0.0, ts=5)row.Are these changes tested?
Yes:
cargo fmt --allcargo clippy --all-targets --all-features -- -D warningsAre there any user-facing changes?
ASOF equality keys can use Float16, Float32, and Float64 while treating signed
zero consistently with join equality. This layer also adds a public physical
expression and an append-only protobuf oneof variant; existing wire tags are not
reused.