PrachiPrakash commented on a change in pull request #7972:
URL: https://github.com/apache/pinot/pull/7972#discussion_r796242482



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -146,23 +146,30 @@ static void validate(PinotQuery pinotQuery)
 
   private static void validateGroupByClause(PinotQuery pinotQuery)
       throws SqlCompilationException {
-    if (pinotQuery.getGroupByList() == null) {
-      return;
-    }
-    // Sanity check group by query: All non-aggregate expression in selection 
list should be also included in group
-    // by list.
-    Set<Expression> groupByExprs = new HashSet<>(pinotQuery.getGroupByList());
+    boolean hasGroupByClause = pinotQuery.getGroupByList() != null;
+    Set<Expression> groupByExprs = hasGroupByClause ? new 
HashSet<>(pinotQuery.getGroupByList()) : null;

Review comment:
       Previously, the logic was like you are suggesting (completely inside a 
different function which was  called in the if block) but after some discussion 
with @siddharthteotia  we agreed to do it this way. Hope thats okay with you




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to