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

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/SqlAsOperator.java
 ##########
 @@ -102,12 +103,26 @@ public void validateCall(
     // we don't want to validate the identifier.
     final List<SqlNode> operands = call.getOperandList();
     assert operands.size() == 2;
-    assert operands.get(1) instanceof SqlIdentifier;
     operands.get(0).validateExpr(validator, scope);
-    SqlIdentifier id = (SqlIdentifier) operands.get(1);
-    if (!id.isSimple()) {
-      throw validator.newValidationError(id,
-          RESOURCE.aliasMustBeSimpleIdentifier());
+
+    SqlNode asIdentifier = operands.get(1);
+    assert asIdentifier instanceof SqlIdentifier
+        || (asIdentifier instanceof SqlNodeList
+            && validator.getConformance().allowSelectTableFunction());
+
 
 Review comment:
   There is a check for this in the Parser.jj, So this should not happen here. 
I use the `assert` but not the `exception`.

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

Reply via email to