-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Feature][Connector-V2] Support like predicate pushdown in paimon #9484
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
Conversation
|
cc @hawk9821 as well. |
Hisoka-X
left a comment
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.
Please update the docs.
OK. |
| Object rightVal = | ||
| convertValueByPaimonDataType(rowType, column.getColumnName(), rightPredicate); | ||
|
|
||
| Pattern BEGIN_PATTERN = Pattern.compile("([^%]+)%"); |
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.
%keyword% not supported . I think should be printe some logs or throw exception.
|
|
||
| The filter condition of the table read. For example: `select * from st_test where id > 100`. If not specified, all rows are read. | ||
| Currently, where conditions only support <, <=, >, >=, =, !=, or, and,is null, is not null, between...and, in, not in, and others are not supported. | ||
| Currently, where conditions only support <, <=, >, >=, =, !=, or, and,is null, is not null, between...and, in, not in, like(only support startWith) ,and others are not supported. |
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.
| Currently, where conditions only support <, <=, >, >=, =, !=, or, and,is null, is not null, between...and, in, not in, like(only support startWith) ,and others are not supported. | |
| Currently, where conditions only support <, <=, >, >=, =, !=, or, and,is null, is not null, between...and, in, not in, like(pattern matching with prefix only) ,and others are not supported. |
| 读取表格的筛选条件,例如:`select * from st_test where id > 100`。如果未指定,则将读取所有记录。 | ||
|
|
||
| 目前,`where` 支持`<, <=, >, >=, =, !=, or, and,is null, is not null, between...and, in , not in`,其他暂不支持。 | ||
| 目前,`where` 支持`<, <=, >, >=, =, !=, or, and,is null, is not null, between...and, in , not in, like(only support startWith)`,其他暂不支持。 |
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.
ditto
| return builder.startsWith(columnIndex, BinaryString.fromString(matcher.group(1))); | ||
| } else { | ||
| throw new IllegalArgumentException( | ||
| "Unsupported expression type: " |
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.
ditto
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
This pull request adds support for like predicate pushdown in Paimon by enhancing the SQL predicate conversion logic, updating end-to-end tests, and revising documentation.
- Enhanced SQL to Paimon predicate conversion to support prefix matching via the LIKE operator.
- Introduced new end-to-end tests to validate the functionality.
- Updated documentation (both English and Chinese) to reflect supported where clause conditions.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/resources/paimon_to_assert_with_filter8.conf | New test configuration file for LIKE predicate tests |
| seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonSinkCDCIT.java | Added test execution for new filter config; increased wait durations |
| seatunnel-connectors-v2/connector-paimon/src/test/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/converter/SqlToPaimonConverterTest.java | Added test validating LIKE predicate conversion for prefix matching |
| seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/converter/SqlToPaimonPredicateConverter.java | Updated SQL predicate converter to handle LIKE expressions with prefix matching |
| docs/zh/connector-v2/source/Paimon.md, docs/en/connector-v2/source/Paimon.md | Updated documentation to include support for like (prefix matching) in the where clause |
| container.executeJob("/changelog_fake_cdc_sink_paimon_case1_ddl.conf"); | ||
| Assertions.assertEquals(0, writeResult.getExitCode()); | ||
| TimeUnit.SECONDS.sleep(20); | ||
| TimeUnit.SECONDS.sleep(120); |
Copilot
AI
Jun 26, 2025
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.
The increased sleep duration to 120 seconds may unnecessarily prolong test execution; consider using a condition-based waiting mechanism to detect readiness instead of a fixed sleep.
| TimeUnit.SECONDS.sleep(120); | |
| given().ignoreExceptions() | |
| .await() | |
| .atMost(120, TimeUnit.SECONDS) | |
| .untilAsserted(() -> { | |
| // Check readiness condition | |
| Container.ExecResult readinessCheck = | |
| container.executeJob("/changelog_fake_cdc_sink_paimon_case1_readiness_check.conf"); | |
| Assertions.assertEquals(0, readinessCheck.getExitCode()); | |
| }); |
| Object rightVal = | ||
| convertValueByPaimonDataType(rowType, column.getColumnName(), rightPredicate); | ||
|
|
||
| Pattern BEGIN_PATTERN = Pattern.compile("([^%]+)%"); |
Copilot
AI
Jun 26, 2025
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.
[nitpick] Consider defining the compiled pattern as a static final constant to avoid recompiling it on each method invocation, which can improve performance and readability.
| Pattern BEGIN_PATTERN = Pattern.compile("([^%]+)%"); |
| throw new IllegalArgumentException( | ||
| "Unsupported expression type: " | ||
| + expression.getClass().getSimpleName() | ||
| + ", only support LikeExpression with 'startWith' pattern "); |
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.
| + ", only support LikeExpression with 'startWith' pattern "); | |
| + ", only support LikeExpression pattern matching with prefix"); |
Hisoka-X
left a comment
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.
LGTM. But we should waiting #9467 be merged first.
|
Hi @xiaochen-zhou . Please rebase on dev to retrigger ci. Thanks |
Purpose of this pull request
Support like predicate pushdown in paimon
Does this PR introduce any user-facing change?
No
How was this patch tested?
Add new tests
Check list
New License Guide