Skip to content

feat(workflow-operator): keep the rows Distinct's engine keeps for NaN and signed zero - #8975

Draft
kz930 wants to merge 1 commit into
apache:mainfrom
kz930:fix/8974-distinct-nan-signed-zero
Draft

kz930 wants to merge 1 commit into
apache:mainfrom
kz930:fix/8974-distinct-nan-signed-zero

Conversation

@kz930

@kz930 kz930 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Distinct's exported Python called drop_duplicates, which counts two NaN values as equal and 0.0 as equal to -0.0. The engine's DistinctOpExec keeps rows in a LinkedHashSet that compares them with Scala's ==, under which NaN equals nothing, and hashes each double by its bits, so 0.0 and -0.0 land apart. The export therefore emitted fewer rows than the run it came from.

The export now selects rows with _texera_set_select, the helper the set operators use: one key per row, equal exactly where the engine's rows are, keeping the first row of each key in input order.

Any related issues, documentation, discussions?

Closes #8974. Depends on #8506, which adds StandaloneHelpers.SetRowKeys; until it merges this branch does not compile.

How was this PR tested?

DistinctOpDescSpec gains a test that runs DistinctOpExec and the exported Python over 1.0, NaN, 0.0, -0.0, null, 1.0, NaN, null, -0.0 and compares the rows in order. The engine keeps 6. The old export kept 4 and fails the test. It replaces the test that pinned the old drop_duplicates line. With #8506 applied, all 11 Distinct tests pass, and Distinct's verification run still matches.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

… and signed zero

The export called drop_duplicates, which counts two NaN values as equal and
0.0 as equal to -0.0. The engine's LinkedHashSet compares rows with Scala's
==, under which NaN equals nothing, and hashes doubles by their bits, so it
keeps all of them. Select rows by the key the set operators already use.

Closes apache#8974

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@codecov-commenter

codecov-commenter commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.61%. Comparing base (6a29c59) to head (35f97a6).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8975      +/-   ##
============================================
- Coverage     92.61%   92.61%   -0.01%     
+ Complexity     5059     5058       -1     
============================================
  Files          1258     1258              
  Lines         53780    53779       -1     
  Branches       6707     6707              
============================================
- Hits          49811    49810       -1     
  Misses         2313     2313              
  Partials       1656     1656              
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø)
agent-service 99.16% <ø> (ø) Carriedforward from 6a29c59
amber 88.10% <ø> (-0.01%) ⬇️ Carriedforward from 6a29c59
computing-unit-managing-service 60.48% <ø> (ø)
config-service 87.37% <ø> (ø)
file-service 82.00% <ø> (ø) Carriedforward from 6a29c59
frontend 96.59% <ø> (ø) Carriedforward from 6a29c59
notebook-migration-service 83.73% <ø> (ø)
pyamber 98.58% <ø> (ø) Carriedforward from 6a29c59
workflow-compiling-service 72.43% <ø> (ø) Carriedforward from 6a29c59

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Arrow Flight E2E bench

(no arrow-flight-e2e.csv in artifact)

Full dashboard · Workflow run

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exported Python for Distinct drops rows the engine keeps when a DOUBLE holds NaN or -0.0

2 participants