xuzifu666 commented on code in PR #4961:
URL: https://github.com/apache/calcite/pull/4961#discussion_r3293780796
##########
core/src/test/java/org/apache/calcite/test/AggregateReduceFunctionsOnGroupKeysRuleTest.java:
##########
@@ -106,6 +106,38 @@ private static RelOptFixture sql(String sql) {
sql(sql).withRule(AGGREGATE_REDUCE_FUNCTIONS_ON_GROUP_KEYS).check();
}
+ @Test void testAggregateFunctionOfGroupByKeysWithCast() {
+ // Test case where a cast is needed because the group key type differs
+ // from the aggregate result type. The rule should preserve the cast.
+ String sql = "select cast(sal as bigint) as sal_big, max(sal) as sal_max\n"
Review Comment:
Yes, I've enhanced the test coverage to address this problem.Based on the
results, information is not lost, which aligns with expectations.
--
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]