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


##########
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableSource.java:
##########
@@ -96,21 +96,35 @@ public JdbcDynamicTableSource(
     public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext 
context) {
         // JDBC only support non-nested look up keys
         String[] keyNames = new String[context.getKeys().length];
-        for (int i = 0; i < keyNames.length; i++) {
+
+        for (int i = 0; i < context.getKeys().length; i++) {
             int[] innerKeyArr = context.getKeys()[i];
             Preconditions.checkArgument(
                     innerKeyArr.length == 1, "JDBC only support non-nested 
look up keys");
             keyNames[i] = 
DataType.getFieldNames(physicalRowDataType).get(innerKeyArr[0]);
         }
+
         final RowType rowType = (RowType) physicalRowDataType.getLogicalType();
+
+        String[] conditions = null;
+        if (this.resolvedPredicates != null) {
+            conditions = new String[this.resolvedPredicates.size()];
+            for (int i = 0; i < this.resolvedPredicates.size(); i++) {
+                String resolvedPredicate = this.resolvedPredicates.get(i);
+                String param = this.pushdownParams[i].toString();
+                conditions[i] = (resolvedPredicate.replace("?", param));

Review Comment:
   @qingwei91 Thanks for the pointer, at the point in the code that you are 
looking at we have access to the statement. But where I am in the code does 
not. I see that the JdbcFilterPushdownPreparedStatementVisitor hard codes a '?' 
literal as the placeholder for the parameter for simple expressions. Still 
looking into this.    



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