dssysolyatin commented on code in PR #2789:
URL: https://github.com/apache/calcite/pull/2789#discussion_r945542384


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -2335,11 +2335,7 @@ private SqlNode registerFrom(
       expr = call.operand(0);
       final boolean needAlias = call.operandCount() > 2
           || expr.getKind() == SqlKind.VALUES
-          || expr.getKind() == SqlKind.UNNEST
-          && (((SqlCall) expr).operand(0).getKind()
-                  == SqlKind.ARRAY_VALUE_CONSTRUCTOR
-              || ((SqlCall) expr).operand(0).getKind()
-                  == SqlKind.MULTISET_VALUE_CONSTRUCTOR);
+          || expr.getKind() == SqlKind.UNNEST;

Review Comment:
   @julianhyde Can you explain why `select * from depts as d, unnest (d.emps)` 
should require alias. It works with PR changes as well. For example:
   ```
   select * from (SELECT ARRAY['banana'] as fruit_arr) as q, 
UNNEST(q.fruit_arr);
   ```
   
   returns (if use current branch)
   ```
   +-----------+--------+
   | FRUIT_ARR | EXPR$0 |
   +-----------+--------+
   | [banana]  | banana |
   +-----------+--------+
   ```
   
   returns (if use PG)
   ```
    fruit_arr | unnest 
   -----------+--------
    {banana}  | banana
   (1 row)
   ```



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