chunweilei commented on a change in pull request #2092:
URL: https://github.com/apache/calcite/pull/2092#discussion_r464979974
##########
File path: core/src/main/java/org/apache/calcite/sql/SqlUtil.java
##########
@@ -1189,4 +1189,19 @@ private void visitChild(SqlNode node) {
return check(type);
}
}
+
+ /**
+ * Whether the selectItem is a table function node in the select.
+ * eg. "select table_func(1) as (f0,f1)"
+ *
+ * @param selectItem select item
+ * @return true if this selectItem is a table function call
+ */
+ public static boolean isTableFunctionInSelect(SqlNode selectItem) {
+ if (selectItem.getKind() == SqlKind.AS) {
+ SqlBasicCall call = (SqlBasicCall) selectItem;
Review comment:
If the second of the `AS` is a `SqlNodeList`, it implies the call is a
`UDTF`. Otherwise, it will throw exception in the next step.
----------------------------------------------------------------
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]