fhueske commented on code in PR #29368:
URL: https://github.com/apache/flink/pull/29368#discussion_r4181802180


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/QueryOperationConverter.java:
##########
@@ -455,6 +424,87 @@ public RelNode visit(CorrelatedFunctionQueryOperation 
correlatedFunction) {
             return relBuilder.build();
         }
 
+        private RelNode convertCorrelatedFunctionWithTableArgs(
+                CorrelatedFunctionQueryOperation correlatedFunction) {
+            final FlinkTypeFactory typeFactory = 
ShortcutUtils.unwrapTypeFactory(relBuilder);
+            final List<RelNode> inputs = new ArrayList<>();
+            final List<RexNode> args = new ArrayList<>();
+            for (ResolvedExpression arg : correlatedFunction.getArguments()) {
+                if (arg instanceof TableReferenceExpression) {
+                    final TableReferenceExpression tableRef = 
(TableReferenceExpression) arg;
+                    args.add(buildTableArgCall(tableRef, inputs.size(), 
typeFactory));
+                    
inputs.add(tableRef.getQueryOperation().accept(QueryOperationConverter.this));
+                } else {
+                    args.add(convertExprToRexNode(arg));
+                }
+            }
+            // Derive the output row type like the FROM-clause PTF path
+            // (FunctionQueryOperation#getOutputDataType).
+            final RelDataType outputType =
+                    typeFactory.buildRelNodeRowType(
+                            (RowType)
+                                    
DataTypeUtils.fromResolvedSchemaPreservingTimeAttributes(
+                                                    
correlatedFunction.getResolvedSchema())
+                                            .getLogicalType());
+            return createTableFunctionScan(
+                    correlatedFunction.getResolvedFunction(), args, inputs, 
outputType);
+        }
+
+        private boolean isSnapshot(FunctionDefinition definition) {

Review Comment:
   Good point! Updated.



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