pengzhiwei2018 commented on a change in pull request #1138: [CALCITE-1581] UDTF 
like in hive
URL: https://github.com/apache/calcite/pull/1138#discussion_r316592589
 
 

 ##########
 File path: core/src/main/codegen/templates/Parser.jj
 ##########
 @@ -1579,15 +1579,38 @@ List<SqlNode> SelectList() :
 SqlNode SelectItem() :
 {
     SqlNode e;
-    final SqlIdentifier id;
+    SqlIdentifier id;
+    final List<SqlNode> ids = new ArrayList();
+    final Span s = span();
 }
 {
     e = SelectExpression()
     [
         [ <AS> ]
-        id = SimpleIdentifier() {
-            e = SqlStdOperatorTable.AS.createCall(span().end(e), e, id);
-        }
+        (
+            (
+              id = SimpleIdentifier()
+              {
+                  e = SqlStdOperatorTable.AS.createCall(s.end(e), e, id);
+              }
+            )
+            |
+            (
+              <LPAREN>
+                 id = SimpleIdentifier()
+                 {
+                    ids.add(id);
+                 }
+                 ( <COMMA> id = SimpleIdentifier() { ids.add(id);} )*
+              <RPAREN>
+              {
+                  if (!this.conformance.allowSelectTableFunction()) {
+                    throw new 
ParseException(RESOURCE.notAllowTableFunctionInSelect().str());
+                  }
 
 Review comment:
   Thanks for you suggestions @danny0405 .

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


With regards,
Apache Git Services

Reply via email to