amaliujia commented on a change in pull request #12169: URL: https://github.com/apache/beam/pull/12169#discussion_r450518142
########## File path: sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/TVFScanConverter.java ########## @@ -42,45 +42,57 @@ @Override public RelNode convert(ResolvedTVFScan zetaNode, List<RelNode> inputs) { RelNode input = inputs.get(0); + RexCall call = + getExpressionConverter() + .convertTableValuedFunction( + input, + zetaNode.getTvf(), + zetaNode.getArgumentList(), + zetaNode.getArgumentList().get(0).getScan() != null + ? zetaNode.getArgumentList().get(0).getScan().getColumnList() + : Collections.emptyList()); RelNode tableFunctionScan = LogicalTableFunctionScan.create( - getCluster(), - inputs, - getExpressionConverter() - .convertTableValuedFunction( - input, - zetaNode.getTvf(), - zetaNode.getArgumentList(), - zetaNode.getArgumentList().get(0).getScan().getColumnList()), - null, - createRowTypeWithWindowStartAndEnd(input.getRowType()), - Collections.EMPTY_SET); + getCluster(), inputs, call, null, call.getType(), Collections.EMPTY_SET); + // Pure SQL UDF's language body is built bottom up, so FunctionArgumentRefMapping should be + // already consumed thus it can be cleared now. + context.clearFunctionArgumentRefMapping(); Review comment: There are a lot more to test, including JOIN and AGGREGATE in UDTVF. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org