Jackie-Jiang commented on a change in pull request #5715:
URL: https://github.com/apache/incubator-pinot/pull/5715#discussion_r457848395
##########
File path:
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -113,7 +113,11 @@ private static void
validateSelectionClause(Map<Identifier, Expression> aliasMap
// Sanity check on selection expression shouldn't use alias reference.
Set<String> aliasKeys = new HashSet<>();
for (Identifier identifier : aliasMap.keySet()) {
- aliasKeys.add(identifier.getName().toLowerCase());
+ String aliasName = identifier.getName().toLowerCase();
+ if (aliasKeys.contains(aliasName)) {
+ throw new SqlCompilationException("Duplicated alias name found.");
+ }
+ aliasKeys.add(aliasName);
Review comment:
(nit)
```suggestion
if (!aliasKeys.add(aliasName)) {
throw new SqlCompilationException("Duplicated alias name found.");
}
```
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]