mihaibudiu commented on code in PR #3950:
URL: https://github.com/apache/calcite/pull/3950#discussion_r1744827988
##########
core/src/test/resources/sql/measure.iq:
##########
@@ -179,6 +179,53 @@ from empm;
!ok
+# [CALCITE-6559] LogicalCorrelate Type mismatch
+# Occurs when AVG measure is applied to SMALLINT or TINYINT column.
+# A CAST is added internally to the result of SUM / COUNT, but this cast
+# prevents a cast to nullable for the null-generating side of an outer join.
+WITH empm AS (
+ SELECT *, AVG(empno) AS MEASURE avg_empno
+ FROM emp)
+SELECT job, avg_empno
+FROM empm
+GROUP BY job;
++-----------+-----------+
+| JOB | AVG_EMPNO |
++-----------+-----------+
+| ANALYST | 7845 |
+| CLERK | 7769 |
+| MANAGER | 7682 |
+| PRESIDENT | 7839 |
+| SALESMAN | 7629 |
++-----------+-----------+
+(5 rows)
+
+!ok
+
+!if (false) {
Review Comment:
Is there an issue filed for this other problem?
--
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]