Improve predicate pushdown coverage in cudf-polars - #23143
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR changes ChangesParquet filter exactness
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
TomAugspurger
left a comment
There was a problem hiding this comment.
Looks nice. Might have an issue with struct columns though:
FAILED py-polars/tests/unit/io/test_delta.py::test_scan_delta_predicate_pushdown_struct_is_not_null - ValueError: CUDF failure at: /__w/cudf/cudf/cpp/src/io/parquet/predicate_pushdown.cpp:162: Column chunk with schema index 1 not found in source 0
https://github.com/rapidsai/cudf/actions/runs/28878719201/job/85673148030?pr=23143#step:13:2937
|
@Matt711 do you want to pick this back up? |
| def _extract_conjuncts(node: expr.Expr) -> list[expr.Expr]: | ||
| if ( | ||
| isinstance(node, expr.BinOp) | ||
| and node.op == plc.binaryop.BinaryOperator.NULL_LOGICAL_AND | ||
| ): | ||
| return [c for child in node.children for c in _extract_conjuncts(child)] | ||
| return [node] |
There was a problem hiding this comment.
Nit: this destroys the dag structure of the expression since it re-traverses all children even if they are already seen.
Description
A predicate that is pushed down to a Scan in the logical plan does not imply it's used in the libcudf parquet reader for row group pruning based on statistics and the post read filter in libcudf. The predicate must first be translatable to libcudf AST. If it is not, then we use the predicate to filter (post read) at the end of Scan execution. This PR makes two improvements
is_nullandis_not_nullto pass through AST conversion because they are supported. I'll do another audit here to see if there are anymore we can allow through.Checklist