davidradl commented on code in PR #79:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/79#discussion_r1411858536


##########
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcRowDataLookupFunction.java:
##########
@@ -92,9 +104,18 @@ public JdbcRowDataLookupFunction(
                                 })
                         .toArray(DataType[]::new);
         this.maxRetryTimes = maxRetryTimes;
-        this.query =
+
+        final String baseSelectStatement =
                 options.getDialect()
                         .getSelectFromStatement(options.getTableName(), 
fieldNames, keyNames);
+        if (conditions == null || conditions.length == 0) {
+            this.query = baseSelectStatement;
+        } else {
+            this.query =
+                    baseSelectStatement
+                            + " AND "

Review Comment:
   > Why do we always chain with `AND`? is baseSelectStatement guaranteed to 
have a condition?
   
   Yes for. lookup join we need at least one lookup key so the 
baseSelectStatement should have these.



-- 
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