cyrilou242 opened a new issue, #13000: URL: https://github.com/apache/pinot/issues/13000
## Problem The following query fails: ``` select OS_Version from CleanLogisticData GROUP BY OS_Version HAVING MAX("timestamp") > 10800 limit 10 ``` With ``` Error Code: 450 InternalError: java.io.IOException: Failed : HTTP error code : 500. Root Cause: Failed to find SELECT expression: OS_Version in the GROUP-BY clause at org.apache.pinot.controller.api.resources.PinotQueryResource.sendPostRaw(PinotQueryResource.java:424) at org.apache.pinot.controller.api.resources.PinotQueryResource.sendRequestRaw(PinotQueryResource.java:462) at org.apache.pinot.controller.api.resources.PinotQueryResource.sendRequestToBroker(PinotQueryResource.java:356) at org.apache.pinot.controller.api.resources.PinotQueryResource.getQueryResponse(PinotQueryResource.java:276) ``` It seems the single stage engine does not accept `HAVING` clause if the aggregation in the `HAVING` clause is not in the `SELECT` clause. This works (but is not the desired query): ``` select OS_Version, MAX("timestamp") as unused from CleanLogisticData GROUP BY OS_Version HAVING MAX("timestamp") > 10800 limit 10 ``` ## Expected behaviour The query should be accepted. It works with the multi-stage engine. I don't know if it's a regression of if it has always behaved like this in the single stage engine. I could reproduce this in `1.1.0-ST.19.5` and OSS `1.0.0` -- 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.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