Skip to content

fix: preserve duplicate rows in result comparisons - #709

Draft
alexanderbianchi wants to merge 1 commit into
datafusion-contrib:mainfrom
alexanderbianchi:tests/fix-result-multiplicity
Draft

fix: preserve duplicate rows in result comparisons#709
alexanderbianchi wants to merge 1 commit into
datafusion-contrib:mainfrom
alexanderbianchi:tests/fix-result-multiplicity

Conversation

@alexanderbianchi

@alexanderbianchi alexanderbianchi commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

compare_result_set checked total row counts and schemas, then compared distinct canonical row strings. It therefore accepted actual [a, a, b] and expected [a, b, b]: equal totals and distinct values, but different duplicate multiplicities.

Count actual/expected occurrences of each existing canonical row string using DataFusion's HashMap with borrowed keys. Report every mismatching row with both counts, sorting only the mismatch diagnostics for deterministic output.

Validation

Using CARGO_TARGET_DIR=/Users/alex.bianchi/.cargo/target:

  • RED: Added regressions against the original implementation. The balanced duplicate-count test failed because the comparator returned Ok(()); the other 9 focused tests passed.
  • GREEN: cargo test -p datafusion-distributed --lib test_utils::property_based --locked — 10 passed.
  • cargo test -p datafusion-distributed --lib --locked — 300 passed, 1 pre-existing ignored test.
  • cargo test -p datafusion-distributed --features integration --test multi_task_collect_join_repros --locked — 10 passed.
  • cargo clippy -p datafusion-distributed --lib --tests --features integration --locked -- -D warnings — passed.
  • cargo fmt --all -- --check and git diff --check — passed.

The full integration, TPC-H, TPC-DS, ClickBench, and chaos suites were not run. Existing null/string serialization collisions and general error equivalence are intentionally outside this fix.

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.

1 participant