Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix full join filtering with duplicate equality keys - #24146

Open
bdice wants to merge 1 commit into
NVIDIA:release/26.10from
bdice:fix/full-join-filter-26.10
Open

Fix full join filtering with duplicate equality keys#24146
bdice wants to merge 1 commit into
NVIDIA:release/26.10from
bdice:fix/full-join-filter-26.10

Conversation

@bdice

@bdice bdice commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Description

FULL join filtering currently splits each rejected candidate independently. With duplicate equality keys, this can emit an unmatched row even when that row has another successful match, or emit the same unmatched row multiple times.

Track successful matches by row identity, preserve every passing pair, and emit exactly one unmatched entry per row with no passing match. AST and JIT filtering share the corrected materialization, and output-size calculation and precomputed-size handling follow the same semantics. Add native regression and stream coverage, and clarify the input-map contract.

Closes #24145. This native fix is needed by the Java FULL filtering coverage in #24097.

Validation

  • The original implementation failed six direct FULL regression cases; the corrected implementation passed all 12 cases, including duplicate/null/empty inputs, ownership, sizing, both JIT entry points, and host/conditional-FULL oracles.
  • JOIN_TEST: 850 passed, 2 existing skips. STREAM_JOIN_TEST: 27 passed.
  • Those runtime checks were run on the original main-based implementation in a CUDA 13.3 conda devcontainer. The seven changed files apply cleanly to release/26.10 and are identical to that validated implementation; release/26.10 runtime validation is left to this PR's CI.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@bdice
bdice requested a review from a team as a code owner September 13, 2026 06:20
@bdice
bdice requested review from lamarrr and vuule September 13, 2026 06:20
@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Sep 13, 2026
bdice added a commit to bdice/cudf that referenced this pull request Sep 13, 2026
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d98754f5-b799-4984-8834-c54ff9493395

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 742e4fd and e8f9439.

πŸ“’ Files selected for processing (7)
  • cpp/include/cudf/join/join.hpp
  • cpp/src/join/filter_join_indices/filter_join_indices.cu
  • cpp/src/join/filter_join_indices/filter_join_indices_jit.cu
  • cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.cuh
  • cpp/src/join/filter_join_indices/full_join.hpp
  • cpp/tests/join/mixed_join_tests.cu
  • cpp/tests/streams/join_test.cpp

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


πŸ“ Summary

Summary by CodeRabbit

  • Bug Fixes

    • Corrected FULL JOIN filtering to preserve matching pairs while retaining unmatched rows from both inputs.
    • Improved handling of duplicate keys, nulls, empty inputs, mixed matches, and many-to-many matches.
    • Fixed output-size calculations for filtered FULL JOIN results.
    • Ensured unmatched rows bypass predicate evaluation and failed candidates do not produce duplicate unmatched rows.
  • Tests

    • Added coverage for conditional and JIT-based FULL JOIN filtering, including post-filtering and unmatched-row materialization.

Walkthrough

Changes

FULL join filtering

Layer / File(s) Summary
FULL join semantics and output counts
cpp/include/cudf/join/join.hpp, cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.cuh
FULL join filtering now retains passing pairs and adds one unmatched pair only for each row without a passing match. Output counts track left and right rows separately.
FULL join materialization and integration
cpp/src/join/filter_join_indices/full_join.hpp, cpp/src/join/filter_join_indices/filter_join_indices.cu, cpp/src/join/filter_join_indices/filter_join_indices_jit.cu
A shared helper tracks successful matches, materializes passing pairs, and appends unmatched rows. Regular and JIT filtering paths use the helper.
FULL join regression coverage
cpp/tests/join/mixed_join_tests.cu, cpp/tests/streams/join_test.cpp
Tests cover duplicate keys, mixed matches, nulls, empty maps, many-to-many matches, output sizing, and regular and JIT post-filtering.

Priority: βž– Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix Β· Severity of issue fixed: Medium

Suggested reviewers: pointkernel

Merge Risk: βšͺ Minimal Β· up to e8f94

Empty candidate maps intentionally remain empty across filtering and sizing paths; no actionable merge risk remains.

πŸš₯ Pre-merge checks | βœ… 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The implementation correctly tracks successful matches by row identity, preserves passing pairs, reconstructs unmatched rows, and routes AST and JIT FULL_JOIN filtering through the shared helper. The … Preserve empty-map semantics. When the candidate index maps are empty, return empty filtered index vectors and return output size zero with empty counts. Ensure the size-provided, AST, and JIT paths use the same result.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.55% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 6 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly and concisely identifies the main change: fixing FULL join filtering for duplicate equality keys.
Description check βœ… Passed The description directly explains the duplicate-key filtering bug, the row-identity fix, affected filtering paths, output-size behavior, tests, and linked issue.
Out of Scope Changes check βœ… Passed The changes are limited to FULL_JOIN filtering, output-size calculation, shared materialization, related documentation, and regression and stream tests. These changes directly support issue #24145 obj…
Full details: Linked Issues check

Explanation

The implementation correctly tracks successful matches by row identity, preserves passing pairs, reconstructs unmatched rows, and routes AST and JIT FULL_JOIN filtering through the shared helper. The new tests cover duplicate keys, nulls, empty tables, sizing, ownership, and streams. However, filter_full_join_indices counts every table row as unmatched when left_indices is empty. filter_join_indices_output_size also allocates left-plus-right counts and converts all zero counts to unmatched entries. The added EmptyMapsWithNonemptyTables test expects no output for empty maps, so this requirement is not met.

Full details: Docstring Coverage

Explanation

Docstring coverage is 4.55% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches πŸ’‘ 1
πŸ› οΈ Fix failing CI checks πŸ’‘
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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

Labels

libcudf Affects libcudf (C++/CUDA) code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant