alamb commented on code in PR #7752:
URL: https://github.com/apache/arrow-datafusion/pull/7752#discussion_r1350295813


##########
datafusion/expr/src/udf.rs:
##########
@@ -18,11 +18,30 @@
 //! Udf module contains foundational types that are used to represent UDFs in 
DataFusion.
 
 use crate::{Expr, ReturnTypeFunction, ScalarFunctionImplementation, Signature};
+use arrow::array::ArrayRef;
+use datafusion_common::Result;
 use std::fmt;
 use std::fmt::Debug;
 use std::fmt::Formatter;
 use std::sync::Arc;
 
+pub trait ScalarFunctionDef: Sync + Send + std::fmt::Debug {

Review Comment:
   > I think using a trait to define functions is more clear and easy to use
   
   Yes, I agree
   
   > And trait ScalarFunctionDef should be equivalent to ScalarUDF 
   
   Maybe we could do something like 
   
   ```rust
   impl SclarFunctionDef for ScalarUDF {
   ...
   }
   ```
   
   So all of DataFusion's code was in terms of `ScalarFunctionDef`.
   
   And then (eventally) deprecate ScalarUDF as part of helping people migrate 
to using `ScalarFunctionUDF` 🤔 
   
   
   



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