feat: support LeafFunction of StartsWith, EndsWith, Contains, Like#130
Open
SteNicholas wants to merge 1 commit intoalibaba:mainfrom
Open
feat: support LeafFunction of StartsWith, EndsWith, Contains, Like#130SteNicholas wants to merge 1 commit intoalibaba:mainfrom
SteNicholas wants to merge 1 commit intoalibaba:mainfrom
Conversation
There was a problem hiding this comment.
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
Contributor
Author
|
Ping @lxy-9602. |
lxy-9602
reviewed
Feb 11, 2026
9b06d92 to
59d3a9f
Compare
e2dc329 to
746a03a
Compare
746a03a to
306fafb
Compare
Contributor
Author
|
Ping @lxy-9602, @lszskye, @lucasfang. |
e82f13f to
5e26060
Compare
zjw1111
reviewed
Feb 14, 2026
5e26060 to
68c5c49
Compare
68c5c49 to
582d9cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.