findepi commented on code in PR #13717:
URL: https://github.com/apache/datafusion/pull/13717#discussion_r1880199776


##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -148,7 +148,9 @@ impl ScalarUDFImpl for DatePartFunc {
     }
 
     fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
-        internal_err!("return_type_from_exprs shoud be called instead")
+        // return type could be Float32 or Int32 depending on the input 
arguments
+        // return_type_from_exprs should be called instead
+        Ok(DataType::Float64)

Review Comment:
   > this is a breaking change and is currently blocking Comet from upgrading 
its DataFusion version.
   
   i agree this is breaking and sorry to hear it affects Comet
   i wish i knew how to make it non-breaking!
   
   it seems this all boils down to the problem that expressions don't know 
their types -- https://github.com/apache/datafusion/issues/12604 
   
   



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to