gortiz commented on code in PR #13664:
URL: https://github.com/apache/pinot/pull/13664#discussion_r1684447814


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/validate/Validator.java:
##########
@@ -147,4 +151,20 @@ protected void addToSelectList(List<SqlNode> list, 
Set<String> aliases,
     }
     super.addToSelectList(list, aliases, fieldList, exp, scope, 
includeSystemVars);
   }
+
+  @Override
+  public void validateWith(SqlWith with, SqlValidatorScope scope) {
+    Set<String> withNames = new HashSet<>();
+
+    for (SqlNode sqlWithItem : with.withList) {
+      for (String name : ((SqlWithItem) sqlWithItem).name.names) {
+        if (withNames.contains(name)) {
+          throw new RuntimeException("Duplicate alias in WITH: '" + name + 
"'");

Review Comment:
   Can we also provide lines? Given we are at SqlNode here, we should be able 
to access them



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

Reply via email to