Skip to content

Use cudf::tables_equal API in libcudf examples - #22428

Merged
rapids-bot[bot] merged 18 commits into
NVIDIA:mainfrom
mhaseeb123:fea/use-table-equal-api
May 15, 2026
Merged

Use cudf::tables_equal API in libcudf examples#22428
rapids-bot[bot] merged 18 commits into
NVIDIA:mainfrom
mhaseeb123:fea/use-table-equal-api

Conversation

@mhaseeb123

@mhaseeb123 mhaseeb123 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Description

Follow up #22319

Use cudf::tables_equal API in libcudf examples instead of anti join to check if two tables are equal

Checklist

wence- and others added 10 commits April 28, 2026 17:57
At various times, it is useful to check whether two tables are equal. For
example, in cudf-polars we use this to check if two tables are
"compatibly" partitioned. Previously there have been no such utilities in
libcudf proper. The best one can do is to loop over the columns, call
cudf::binary_operation with NULL_EQUALS and then cudf::reduce on the
result. This launches many more kernels than necessary.

Instead, use the existing row_equality operators to perform a single
transform_reduce over the table checking for equality.
The row_operator function is too complex for transform-reduce, resulting in
very long compile times in general, and a bug in cicc 13.1.
Previously if two tables had column types that were not
equality-comparable, cudf::logic_error was thrown, while the documented
exception was std::invalid_argument. Fix this by throwing the correct
exception.
@mhaseeb123
mhaseeb123 requested review from a team as code owners May 8, 2026 19:03
@copy-pr-bot

copy-pr-bot Bot commented May 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@mhaseeb123
mhaseeb123 requested a review from ttnghia May 8, 2026 19:03
@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels May 8, 2026
@mhaseeb123
mhaseeb123 marked this pull request as draft May 8, 2026 19:03
@mhaseeb123
mhaseeb123 removed request for a team and KyleFromNVIDIA May 8, 2026 19:07
@mhaseeb123 mhaseeb123 added 2 - In Progress Currently a work in progress non-breaking Non-breaking change improvement Improvement / enhancement to an existing function labels May 8, 2026
@mhaseeb123 mhaseeb123 moved this to Burndown in libcudf May 8, 2026
@mhaseeb123
mhaseeb123 marked this pull request as ready for review May 13, 2026 00:23
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Review 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: cac3385e-1858-414d-bd53-5fd170ce802d

📥 Commits

Reviewing files that changed from the base of the PR and between 4d9b086 and 774d67e.

📒 Files selected for processing (3)
  • cpp/examples/hybrid_scan_io/common_utils.cpp
  • cpp/examples/parquet_io/common_utils.cpp
  • cpp/examples/parquet_io/parquet_io.cpp
💤 Files with no reviewable changes (1)
  • cpp/examples/parquet_io/parquet_io.cpp

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Simplified table equality validation in example utilities by adopting direct comparison methods, improving code clarity and consistency across examples.

Walkthrough

This PR refactors table equality checking in RAPIDS cuDF C++ examples, replacing anti-join-based comparisons with direct cudf::tables_equal API calls across the hybrid_scan_io and parquet_io example projects, along with supporting header dependency updates.

Changes

Table Equality Refactoring

Layer / File(s) Summary
hybrid_scan_io equality check simplification
cpp/examples/hybrid_scan_io/common_utils.cpp
Includes updated to cudf/table/equality.hpp; check_tables_equal rewritten to use cudf::tables_equal with null equality, removing prior filtered-join logic and exception-catching behavior, now throws std::logic_error on inequality.
parquet_io equality check and dependencies
cpp/examples/parquet_io/common_utils.cpp, cpp/examples/parquet_io/parquet_io.cpp
Parquet_io example receives matching equality refactoring with cudf::tables_equal replacement; header include in parquet_io.cpp switches from io_source.hpp to common_utils.hpp.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • rapidsai/cudf#22319: Adds the new cudf::tables_equal API that these example updates now depend on.

Suggested reviewers

  • ttnghia
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: replacing anti-join-based table equality checks with the cudf::tables_equal API in examples.
Description check ✅ Passed The description is related to the changeset, explaining the follow-up nature and the specific intent to replace anti-join checks with cudf::tables_equal API in examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@mhaseeb123 mhaseeb123 added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels May 13, 2026
@mhaseeb123

Copy link
Copy Markdown
Contributor Author

/ok to test 774d67e

@mhaseeb123 mhaseeb123 added 4 - Needs Review Waiting for reviewer to review or respond and removed 3 - Ready for Review Ready for review by team labels May 13, 2026

@davidwendt davidwendt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL std::boolalpha

@mhaseeb123 mhaseeb123 added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 4 - Needs Review Waiting for reviewer to review or respond labels May 14, 2026
@mhaseeb123
mhaseeb123 removed the request for review from a team May 14, 2026 18:09
@mhaseeb123

Copy link
Copy Markdown
Contributor Author

/ok to test 86af179

@vuule

vuule commented May 15, 2026

Copy link
Copy Markdown
Contributor

/ok to test 919af4e

@mhaseeb123

Copy link
Copy Markdown
Contributor Author

/ok to test d10fd7b

@mhaseeb123

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit fc0598f into NVIDIA:main May 15, 2026
115 checks passed
@mhaseeb123
mhaseeb123 deleted the fea/use-table-equal-api branch May 15, 2026 20:54
@mhaseeb123 mhaseeb123 moved this from Burndown to Landed in libcudf May 15, 2026
@GregoryKimball GregoryKimball removed this from libcudf Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to Merge Testing and reviews complete, ready to merge CMake CMake build issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants