-
Notifications
You must be signed in to change notification settings - Fork 28
feat: support LeafFunction of StartsWith, EndsWith, Contains, Like #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds support for string pattern-matching leaf predicates (StartsWith, EndsWith, Contains, Like) so they can be evaluated as LeafFunctions and (for Parquet) converted into Arrow compute expressions.
Changes:
- Introduces new
Function::Typevariants and corresponding leaf-function implementations for string predicates. - Extends Parquet
PredicateConverterto convert these new leaf predicates into Arrow compute expressions. - Updates predicate negation to allow “non-negatable” leaf functions (via nullable
Negate()), and expands unit tests accordingly.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/format/parquet/predicate_converter_test.cpp | Adds Parquet conversion assertions for the new string leaf predicates. |
| src/paimon/format/parquet/predicate_converter.cpp | Adds Arrow compute conversion cases for STARTS_WITH / ENDS_WITH / CONTAINS / LIKE. |
| src/paimon/common/predicate/string_leaf_binary_function.h | Introduces a shared base for string binary leaf functions. |
| src/paimon/common/predicate/starts_with.h | Implements StartsWith leaf-function logic for string values (and stats filtering attempt). |
| src/paimon/common/predicate/ends_with.h | Implements EndsWith leaf-function logic for string values. |
| src/paimon/common/predicate/contains.h | Implements Contains leaf-function logic for string values. |
| src/paimon/common/predicate/like.h | Implements Like leaf-function logic for SQL-like patterns. |
| src/paimon/common/predicate/predicate_utils.h | Extends visitor dispatch to support the new leaf predicate function types. |
| src/paimon/common/predicate/predicate_test.cpp | Renames bigint row helper, adds string row helper, and adds tests for new string predicates. |
| src/paimon/common/predicate/predicate_builder.cpp | Wires new builder helpers and includes for string predicates. |
| src/paimon/common/predicate/not_in.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/not_in.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/not_equal.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/not_equal.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/less_than.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/less_than.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/less_or_equal.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/less_or_equal.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/leaf_predicate.cpp | Makes predicate negation return nullptr when unsupported by leaf function. |
| src/paimon/common/predicate/leaf_function.h | Changes LeafFunction::Negate() to return const LeafFunction* (nullable). |
| src/paimon/common/predicate/is_null.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/is_null.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/is_not_null.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/is_not_null.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/in.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/in.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/greater_than.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/greater_than.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/greater_or_equal.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/greater_or_equal.cpp | Updates Negate() implementation to return pointer. |
| src/paimon/common/predicate/equal.h | Updates Negate() signature to pointer-returning form. |
| src/paimon/common/predicate/equal.cpp | Updates Negate() implementation to return pointer. |
| include/paimon/predicate/predicate_builder.h | Adds public builder APIs for StartsWith/EndsWith/Contains/Like. |
| include/paimon/predicate/function.h | Extends function type enum with STARTS_WITH / ENDS_WITH / CONTAINS / LIKE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
052fd68 to
5443224
Compare
|
Ping @lxy-9602. |
9b06d92 to
59d3a9f
Compare
e2dc329 to
746a03a
Compare
746a03a to
306fafb
Compare
|
Ping @lxy-9602, @lszskye, @lucasfang. |
c743d76 to
e82f13f
Compare
e82f13f to
5e26060
Compare
Purpose
Linked issue: close #110
Support
LeafFunctionof predicates includingStartsWith,EndsWith,Contains,Like.Tests
PredicateTest, TestStartsWithPredicateTest, TestStartsWithNullPredicateTest, TestEndsWithPredicateTest, TestEndsWithNullPredicateTest, TestContainsPredicateTest, TestContainshNullPredicateTest, TestLikePredicateConverterTest, TestSimplePredicatePushdownTest, TestStringDataAPI and Format
No.
Documentation
No.