davidradl commented on code in PR #79:
URL:
https://github.com/apache/flink-connector-jdbc/pull/79#discussion_r1411924736
##########
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 "
+ +
Arrays.stream(conditions).collect(Collectors.joining(" AND "));
Review Comment:
I tested this - there are already brackets around the condition, so we
should not have a problem with precidence
--
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]