friendlymatthew commented on code in PR #23844:
URL: https://github.com/apache/datafusion/pull/23844#discussion_r3639341544


##########
datafusion/sqllogictest/test_files/case.slt:
##########
@@ -41,6 +41,24 @@ NULL
 6
 7
 
+# CASE nullability remains consistent through type coercion
+query II rowsort
+SELECT endpoint, count(*)
+FROM (
+  SELECT CASE
+    WHEN a IS NOT NULL THEN CAST(a AS BIGINT)
+    ELSE CAST(0 AS BIGINT)
+  END AS endpoint
+  FROM foo
+)
+GROUP BY endpoint

Review Comment:
   This seems to be the simplest repro. At the sql level, a plain projection 
still executes because nothing consumes the conflicting nullability. The 
aggregate is what exposes the logical/physical schema mismatch



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