dssysolyatin commented on code in PR #2789:
URL: https://github.com/apache/calcite/pull/2789#discussion_r948796033
##########
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 I would rename `needAlias` to `needAliasNamespace`. Also it
should be taken into account that this code will be executed only if there is
`AS` operator. If there is no `AS` operator like in your case, it will be work
as usual
```
switch (kind) {
case AS:
call = (SqlCall) node;
if (alias == null) {
alias = String.valueOf(call.operand(1));
}
expr = call.operand(0);
final boolean needAliasNamespace = call.operandCount() > 2
|| expr.getKind() == SqlKind.VALUES
|| expr.getKind() == SqlKind.UNNEST;
```
--
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]