tarun11Mavani commented on PR #13792:
URL: https://github.com/apache/pinot/pull/13792#issuecomment-2282812578

   > Is this behavior Standard SQL / Postgres compliant.
   > 
   > If the SELECT clause is not matching the GROUP BY clause and there are no 
aggregations, then why should we not throw error ?
   
   I think this is standard SQL/Postgres compliant. I tried below queries in 
mysql and it works fine. The same in working fine with Pinot Multi-stage engine 
as well.
   
   > CREATE TABLE testing_groupby (
   >     row_num INT,
   >     id VARCHAR(50),
   >     nm VARCHAR(50),
   >     cnt INT
   > );
   > 
   > INSERT INTO testing_groupby (row_num, id, nm, cnt) VALUES 
   > (1, 'a-', 'name', 0),
   > (2, 'a', '-name', 1),
   > (2, 'b', '-name', 2);
   > 
   > SELECT row_num
   > FROM testing_groupby 
   > GROUP BY row_num, cnt;
   > 
   > +---------+
   > | row_num |
   > +---------+
   > |       1 |
   > |       2 |
   > |       2 |
   > +---------+
   >
   >
   > SELECT row_num + cnt
   > FROM testing_groupby 
   > GROUP BY row_num, cnt; 
   >
   > +---------------+
   > | row_num + cnt |
   > +---------------+
   > |             1 |
   > |             3 |
   > |             4 |
   > +---------------+
   


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