FrankChen021 commented on code in PR #19976:
URL: https://github.com/apache/druid/pull/19976#discussion_r3766626984
##########
sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParserUtils.java:
##########
@@ -475,6 +475,14 @@ public static void validateClusteredByColumns(final
SqlNodeList clusteredByNodes
);
}
+ // Aliases like "CLUSTERED BY col AS alias" are not allowed.
+ if (clusteredByNode.isA(ImmutableSet.of(SqlKind.AS))) {
Review Comment:
[P2] Alias hidden by NULLS FIRST
`expr AS alias NULLS FIRST` becomes `NULLS_FIRST(AS(expr, alias))`, so the
top-level `AS` check misses it. The node is then carried into
clustering/order-by handling and can produce an invalid cluster-key mapping.
Reject aliases recursively through ordering wrappers.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]