You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "mihaibudiu (via GitHub)" <gi...@apache.org> on 2026/09/12 18:26:32 UTC
Re: [PR] [CALCITE-7744] ORDER BY agg(col) on a query where an alias shadows col produces an invalid plan containing an aggregate call in a Project [calcite]
mihaibudiu commented on code in PR #5225:
URL: https://github.com/apache/calcite/pull/5225#discussion_r3997139535
##########
core/src/test/java/org/apache/calcite/test/JdbcTest.java:
##########
@@ -3391,6 +3391,14 @@ void testJoinWithTrimmingConfigs(boolean enableTrimmingByConfig,
+ "store_id=0; grocery_sqft=null\n");
}
+ @Test void testOrderByAggregateAliasShadowing() {
+ CalciteAssert.that()
+ .with(CalciteAssert.Config.SCOTT)
+ .query("SELECT max(sal) AS sal, deptno, job "
+ + "FROM emp GROUP BY deptno, job ORDER BY max(sal)")
+ .throws_("Aggregate expressions cannot be nested");
Review Comment:
This error message is not very clear; I know you didn't create it. Does the error at least point to the offending aggregate?
--
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-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org