twalthr commented on a change in pull request #11081: [FLINK-16033][table-api]
Introduced Java Table API Expression DSL
URL: https://github.com/apache/flink/pull/11081#discussion_r385595579
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/factories/CalculatedTableFactory.java
##########
@@ -95,42 +94,87 @@ public FunctionTableCallVisitor(String[]
leftTableFieldNames) {
}
CallExpression tableCall = (CallExpression)
children.get(0);
- TableFunctionDefinition tableFunctionDefinition =
- (TableFunctionDefinition)
tableCall.getFunctionDefinition();
- return createFunctionCall(tableFunctionDefinition,
aliases, tableCall.getResolvedChildren());
+ return createFunctionCall(tableCall, aliases);
+ }
+
+ private CalculatedQueryOperation<?>
createFunctionCall(CallExpression call, List<String> aliases) {
+ FunctionDefinition definition =
call.getFunctionDefinition();
+ if (definition instanceof TableFunctionDefinition) {
+ return createFunctionCall(
+ ((TableFunctionDefinition)
definition).getTableFunction(),
+
call.getFunctionIdentifier().orElse(FunctionIdentifier.of(definition.toString())),
+ call.getOutputDataType(),
+ aliases,
+ call.getResolvedChildren());
+ } else if (definition instanceof TableFunction<?>) {
Review comment:
Check function kind instead?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services