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


##########
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:
   ```suggestion
       fn return_type_from_exprs<S: ExprSchema>(
           &self,
           arg_exprs: &[Expr],
           schema: S,
       ) -> Result<DataType> {
   ```
   @Weijun-H If I'd like to make a change like this, there's an error 🥲
   > for a trait to be "object safe" it needs to allow building a vtable to 
allow the call to be resolvable dynamically;



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