yyy1000 commented on code in PR #8985:
URL: https://github.com/apache/arrow-datafusion/pull/8985#discussion_r1469787854


##########
datafusion/expr/src/udf.rs:
##########
@@ -249,6 +261,22 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
     /// the arguments
     fn return_type(&self, arg_types: &[DataType]) -> Result<DataType>;
 
+    /// What [`DataType`] will be returned by this function, given the types of
+    /// the expr arguments
+    fn return_type_from_exprs(
+        &self,
+        arg_exprs: &[Expr],
+        schema: &DFSchema,
+    ) -> Result<DataType> {

Review Comment:
   I tried `&dyn ExprSchema` before, there will be an issue when calling 
`get_type`, like below. 🥲. I also tried the fix method recommended by the 
complier(adding `+?Sized` but failed)
   <img width="1252" alt="Screenshot 2024-01-29 at 9 40 10 AM" 
src="https://github.com/apache/arrow-datafusion/assets/69566909/0c0a2a8c-f16f-4ec5-bd26-d779b3aa200e";>
   



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

Reply via email to