Skip to content

Improve Parquet case-insensitive column selection semantics - #22729

Merged
rapids-bot[bot] merged 7 commits into
NVIDIA:mainfrom
qbacpey:fea/normalize-str-21864
Jun 3, 2026
Merged

Improve Parquet case-insensitive column selection semantics#22729
rapids-bot[bot] merged 7 commits into
NVIDIA:mainfrom
qbacpey:fea/normalize-str-21864

Conversation

@qbacpey

@qbacpey qbacpey commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Close #21864

Follow-up to #21700. That PR repeated normalize_column_path(...) at every insertion/lookup of the column-name hash containers. As suggested, this PR encapsulates that policy in a small pair of hash/equality functors that carry the case_sensitive_names policy.

Checklist

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

@qbacpey qbacpey added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Jun 1, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Comment thread cpp/benchmarks/io/parquet/parquet_reader_metadata.cpp
@qbacpey qbacpey added the improvement Improvement / enhancement to an existing function label Jun 1, 2026
@qbacpey

qbacpey commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Benchmark — no statistically significant overhead

No statistically significant change was observed; deltas stay near zero, CIs include zero, and the spread matches same-code run-to-run noise.

comparison light — signed mean (95% CI) heavy — signed mean (95% CI) within noise
branch vs main (change) −0.4% ([−4.1, +3.3]) −0.5% ([−2.1, +1.2]) 16/16
same code twice (control) −1.3% ([−2.9, +0.3]) −0.3% ([−1.6, +0.9]) 16/16

Light filter

Filter references 1 column (1 name lookup)

image

Heavy filter (every column referenced)

Filter references every column (O(num_cols) lookups)

image

Wrap-up

main (blue) and branch (orange) bars overlap at every column count in both regimes. No measurable overhead

@qbacpey
qbacpey marked this pull request as ready for review June 1, 2026 15:01
@qbacpey
qbacpey requested a review from a team as a code owner June 1, 2026 15:01
@qbacpey
qbacpey requested review from PointKernel and mhaseeb123 June 1, 2026 15:01
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds case-sensitivity-aware column-path utilities and factories, replaces ad-hoc normalization with transparent container-based maps/sets in Parquet expression and hybrid-scan code, wires the new source into the build, and adds an NVBench verifying AST filter name-to-column resolution.

Changes

Case-Sensitive Column Path Utilities and Reader Integration

Layer / File(s) Summary
Column-path helpers and build integration
cpp/src/io/parquet/column_path_helpers.hpp, cpp/src/io/parquet/column_path_helpers.cpp, cpp/CMakeLists.txt, cpp/src/io/parquet/reader_impl_helpers.cpp, cpp/src/io/parquet/reader_impl_helpers.hpp
Adds normalize_column_path/are_column_paths_equal, transparent column_path_hash/column_path_equal, column_path_set/column_path_map aliases, and make_* factories; wires new column_path_helpers.cpp into the cudf target and removes local normalizer declarations.
Expression-transform integration
cpp/src/io/parquet/expression_transform_helpers.hpp, cpp/src/io/parquet/expression_transform_helpers.cpp
Refactors names_from_expression and named_to_reference_converter to use column_path_set/column_path_map<size_type>, removes stored _case_sensitive_names, and switches lookups/skip-checks to use raw expression keys with the transparent containers.
Hybrid-scan filter integration
cpp/src/io/parquet/experimental/hybrid_scan_helpers.cpp
Replaces per-name normalization logic in select_payload_columns and named_to_reference_converter with make_column_path_set(case_sensitive_names)-backed sets and direct membership/map lookups using schema names.
Filter name-resolution benchmark
cpp/benchmarks/io/parquet/parquet_reader_metadata.cpp
Adds BM_parquet_filter_name_resolution NVBench that creates deterministic Parquet schemas and AST predicates (case-sensitive/insensitive, light/heavy) and times cudf::io::chunked_parquet_reader construction to validate name resolution.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Possibly related PRs

  • rapidsai/cudf#22616: Touches experimental/hybrid_scan_helpers.cpp and modifies filter/payload column matching and named-to-reference mapping; closely related to the hybrid-scan/name-resolution changes in this PR.

Suggested reviewers

  • davidwendt
  • PointKernel
  • lamarrr
  • mythrocks
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve Parquet case-insensitive column selection semantics' accurately and concisely describes the primary change: refactoring column-name matching to encapsulate normalization in hash/equality functors rather than repeating normalize calls throughout the codebase.
Description check ✅ Passed The description is related to the changeset, explaining that it follows up on PR #21700 by encapsulating normalization policy in hash/equality functors, which aligns with the code changes that introduce column_path_helpers with these functors.
Linked Issues check ✅ Passed The PR successfully implements the objectives from #21864: defines hash/equality functors (column_path_hash, column_path_equal) with case-sensitivity policies, creates container aliases (column_path_set, column_path_map) using these functors, and removes scattered normalize calls throughout the codebase.
Out of Scope Changes check ✅ Passed All changes are in scope. They focus on centralizing normalization logic via column_path_helpers (new file with helper functions and functors), updating internal implementations to use these helpers, adding a benchmark for the new functionality, and removing outdated normalization functions. No extraneous changes detected.

✏️ 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.

@PointKernel PointKernel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very clean code. Only some non-blocking nits.

Thanks!

Comment thread cpp/benchmarks/io/parquet/parquet_reader_metadata.cpp
Comment thread cpp/src/io/parquet/experimental/hybrid_scan_helpers.cpp Outdated
Comment thread cpp/src/io/parquet/reader_impl_helpers.hpp Outdated
Comment thread cpp/benchmarks/io/parquet/parquet_reader_metadata.cpp
Comment thread cpp/benchmarks/io/parquet/parquet_reader_metadata.cpp Outdated
@mhaseeb123 mhaseeb123 changed the title Improve semantics of case-insensitive column matching/selection in the Parquet reader Improve Parquet case-insensitive column selection semantics Jun 2, 2026
@qbacpey
qbacpey force-pushed the fea/normalize-str-21864 branch from bfb83c0 to a96800e Compare June 2, 2026 08:20
@qbacpey
qbacpey requested a review from a team as a code owner June 2, 2026 08:20
@github-actions github-actions Bot added the CMake CMake build issue label Jun 2, 2026
@qbacpey
qbacpey requested a review from mhaseeb123 June 2, 2026 11:53
@qbacpey qbacpey added 4 - Needs Review Waiting for reviewer to review or respond and removed 2 - In Progress Currently a work in progress labels Jun 2, 2026
Comment thread cpp/src/io/parquet/column_path_helpers.hpp Outdated
Comment thread cpp/src/io/parquet/column_path_helpers.hpp Outdated
Comment thread cpp/src/io/parquet/column_path_helpers.hpp Outdated
@qbacpey
qbacpey force-pushed the fea/normalize-str-21864 branch from d2993e8 to c3ac600 Compare June 2, 2026 21:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cpp/src/io/parquet/column_path_helpers.cpp (1)

32-35: ⚡ Quick win

Simplify the comparison lambda for clarity.

The std::equal_to<>{} call is unnecessarily verbose. Direct == comparison is more idiomatic and clearer.

♻️ Simplified comparison
   return std::equal(
     lhs.begin(), lhs.end(), rhs.begin(), [](unsigned char lhs_char, unsigned char rhs_char) {
-      return std::equal_to<>{}(std::tolower(lhs_char), std::tolower(rhs_char));
+      return std::tolower(lhs_char) == std::tolower(rhs_char);
     });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/src/io/parquet/column_path_helpers.cpp` around lines 32 - 35, The lambda
inside the std::equal call can be simplified: replace the verbose
std::equal_to<>{}(std::tolower(lhs_char), std::tolower(rhs_char)) expression in
the lambda (the one taking lhs_char and rhs_char) with a direct == comparison of
the two std::tolower results; update the lambda used in the std::equal(...)
invocation in column_path_helpers.cpp accordingly for clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cpp/src/io/parquet/column_path_helpers.cpp`:
- Around line 32-35: The lambda inside the std::equal call can be simplified:
replace the verbose std::equal_to<>{}(std::tolower(lhs_char),
std::tolower(rhs_char)) expression in the lambda (the one taking lhs_char and
rhs_char) with a direct == comparison of the two std::tolower results; update
the lambda used in the std::equal(...) invocation in column_path_helpers.cpp
accordingly for clarity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4d0880da-19dd-4dcb-ba6d-e4499b47a5a5

📥 Commits

Reviewing files that changed from the base of the PR and between d2993e8 and c3ac600.

📒 Files selected for processing (9)
  • cpp/CMakeLists.txt
  • cpp/benchmarks/io/parquet/parquet_reader_metadata.cpp
  • cpp/src/io/parquet/column_path_helpers.cpp
  • cpp/src/io/parquet/column_path_helpers.hpp
  • cpp/src/io/parquet/experimental/hybrid_scan_helpers.cpp
  • cpp/src/io/parquet/expression_transform_helpers.cpp
  • cpp/src/io/parquet/expression_transform_helpers.hpp
  • cpp/src/io/parquet/reader_impl_helpers.cpp
  • cpp/src/io/parquet/reader_impl_helpers.hpp
🚧 Files skipped from review as they are similar to previous changes (5)
  • cpp/CMakeLists.txt
  • cpp/src/io/parquet/expression_transform_helpers.cpp
  • cpp/src/io/parquet/column_path_helpers.hpp
  • cpp/src/io/parquet/experimental/hybrid_scan_helpers.cpp
  • cpp/src/io/parquet/reader_impl_helpers.hpp

@mhaseeb123 mhaseeb123 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.

Approving with minor optional nits. Great work 🚀

Comment thread cpp/src/io/parquet/column_path_helpers.hpp
Comment thread cpp/src/io/parquet/column_path_helpers.hpp Outdated
@qbacpey
qbacpey force-pushed the fea/normalize-str-21864 branch from c3ac600 to c336e0a Compare June 3, 2026 10:09
@qbacpey qbacpey 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 Jun 3, 2026
@qbacpey

qbacpey commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 2548104 into NVIDIA:main Jun 3, 2026
219 of 225 checks passed
@qbacpey
qbacpey deleted the fea/normalize-str-21864 branch June 3, 2026 12:08
@coderabbitai coderabbitai Bot mentioned this pull request Jun 24, 2026
3 tasks
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.

[FEA] Consider a normalized string type in PQ for case insensitive col selection

3 participants