fx19880617 commented on a change in pull request #5014: fixing converting 
PinotQuery to BrokerRequest for group by clause with selections
URL: https://github.com/apache/incubator-pinot/pull/5014#discussion_r370819544
 
 

 ##########
 File path: 
pinot-common/src/test/java/org/apache/pinot/sql/parsers/CalciteSqlCompilerTest.java
 ##########
 @@ -832,4 +849,17 @@ public void testSqlDistinctQueryCompilation() {
     
Assert.assertEquals(aggregationInfo.getAggregationParams().get(FunctionCallAstNode.COLUMN_KEY_IN_AGGREGATION_INFO),
         "add(div(col1,col2),mul(col3,col4)):sub(col3,col4):col5:col6");
   }
+
+  @Test
+  public void testQueryValidationFailure() {
+    String sql;
+    try {
+      sql = "select group_city,group_country, sum(rsvp_count), count(*) from 
meetupRsvp group by group_country, sum(rsvp_count), count(*) limit 50";
 
 Review comment:
   GROUP BY clause shouldn't contain aggregate expression like sum(PostalCode), 
however, you can still do dateConverter(secondsSinceEpoch) etc, which is 
non-aggregate Transform function. Or expressions like ADD(a,b). 
   
   My validate assumes that group by clause is always non-aggregate expression, 
so that we could extract all the identifier from 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to