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


##########
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcRowDataLookupFunction.java:
##########
@@ -92,9 +103,22 @@ 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;
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Issuing look up select {}", this.query);
+            }
+        } else {
+            this.query = baseSelectStatement + " AND " + String.join(" AND ", 
conditions);

Review Comment:
   
[https://github.com/apache/flink-connector-jdbc/blob/e3dd84160cd665ae17672da8b6e742e61a72a32d/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/AbstractDialect.java#L198](https://github.com/apache/flink-connector-jdbc/blob/e3dd84160cd665ae17672da8b6e742e61a72a32d/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/AbstractDialect.java#L198)
 puts in a WHERE clause if there are conditions and this else is only when 
there are conditions. 



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to