beyond1920 commented on code in PR #2844:
URL: https://github.com/apache/calcite/pull/2844#discussion_r917343155


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -3380,6 +3384,66 @@ protected void validateFrom(
     getNamespaceOrThrow(node, scope).validate(targetRowType);
   }
 
+  protected void validateTableFunction(SqlCall node, SqlValidatorScope scope,
+      RelDataType targetRowType) {
+    // Dig out real call; TABLE() wrapper is just syntactic.
+    SqlCall call = node.operand(0);
+    if (call.getOperator() instanceof SqlTableFunction) {
+      SqlTableFunction tableFunction = (SqlTableFunction) call.getOperator();

Review Comment:
   I prefer to keep `instance of` here.
   because `ProcedureNamespace#validateImpl` do a validation after this step.
   If I remove `instance of` here, the exception would thrown an exception 
right here when handling illegal cases like 
`SqlValidatorTest#testCollectionTable`.
   If I want to throw a same exception like the previous behavior, I have to 
use ` ! instance of` to find illegal cases.
   WDYT?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to