tarun11Mavani commented on code in PR #13792:
URL: https://github.com/apache/pinot/pull/13792#discussion_r1722697771


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java:
##########
@@ -2776,6 +2776,18 @@ public void testNonAggregationGroupByQuery(boolean 
useMultiStageQueryEngine)
     h2Query = "SELECT CAST(ArrTime-DepTime AS FLOAT) FROM mytable GROUP BY 
CAST(ArrTime-DepTime AS FLOAT)";
     testQuery(pinotQuery, h2Query);
 
+    pinotQuery = "SELECT ArrTime-DepTime FROM mytable GROUP BY ArrTime, 
DepTime LIMIT 1000000";

Review Comment:
   Both MySQL and Postgres fails such query by default but MySQL has an option 
to allow such query by setting up the only_full_group_by flag to false. 
   
   In Pinot, we will always fail the query if a column in SELECT clause is not 
functionally dependent on columns from GROUP BY clause as part of the 
validation check performed immediately after the rewrite. The 
[validateGroupByClause](https://github.com/apache/pinot/blob/53fbf88027c47b3c6f7d1526576ba0bd257fe9d5/pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java#L550)
 function is invoked in 
[CalciteSqlParser](https://github.com/apache/pinot/blob/53fbf88027c47b3c6f7d1526576ba0bd257fe9d5/pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java#L550)
 to recursively check whether an expression contains any references that are 
not included in the GROUP BY clause. 
   



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