james-willis commented on code in PR #27143:
URL: https://github.com/apache/datafusion/pull/27143#discussion_r4529678206


##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -1307,6 +1325,24 @@ impl PhysicalExpr for CaseExpr {
         }
     }
 
+    fn return_field(&self, input_schema: &Schema) -> Result<FieldRef> {

Review Comment:
   I wish this just wouldn't plan but I didn't make the change in this or my 
prior PR (#27143) because of some unpleasant implications.
   
   In my prior planning PR we made mismatched "ARROW:extension:name" an error 
but the pair of a present and a null one goes to the present value. 
   
   IMO this should be a planning error because ARROW:extension:name really 
defines the type and types should match between branches but it leads to some 
unpleasant situations especially around literals, for example 
`COALESCE(json_col, '{}')` would fail. 



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