Copilot commented on code in PR #9484:
URL: https://github.com/apache/seatunnel/pull/9484#discussion_r2167993626


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonSinkCDCIT.java:
##########
@@ -533,11 +536,11 @@ public void testSinkPaimonTruncateTable(TestContainer 
container) throws Exceptio
 
     @TestTemplate
     public void testChangelogLookup(TestContainer container) throws Exception {
-        // create Piamon table (changelog-producer=lookup)
+        // create Paimon table (changelog-producer=lookup)
         Container.ExecResult writeResult =
                 
container.executeJob("/changelog_fake_cdc_sink_paimon_case1_ddl.conf");
         Assertions.assertEquals(0, writeResult.getExitCode());
-        TimeUnit.SECONDS.sleep(20);
+        TimeUnit.SECONDS.sleep(120);

Review Comment:
   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.
   ```suggestion
           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());
                   });
   ```



##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/converter/SqlToPaimonPredicateConverter.java:
##########
@@ -241,6 +244,24 @@ private static Predicate parseExpressionToPredicate(
             Object paimonEndVal =
                     convertValueByPaimonDataType(rowType, 
column.getColumnName(), jsqlEndVal);
             return builder.between(columnIndex, paimonStartVal, paimonEndVal);
+        } else if (expression instanceof LikeExpression) {
+            LikeExpression like = (LikeExpression) expression;
+            Column column = (Column) like.getLeftExpression();
+            int columnIndex = getColumnIndex(builder, column);
+            Object rightPredicate = 
getJSQLParserDataTypeValue(like.getRightExpression());
+            Object rightVal =
+                    convertValueByPaimonDataType(rowType, 
column.getColumnName(), rightPredicate);
+
+            Pattern BEGIN_PATTERN = Pattern.compile("([^%]+)%");

Review Comment:
   [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.
   ```suggestion
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to