jorgecarleitao commented on a change in pull request #7967:
URL: https://github.com/apache/arrow/pull/7967#discussion_r471134987



##########
File path: rust/datafusion/src/execution/physical_plan/udf.rs
##########
@@ -37,8 +37,11 @@ pub type ScalarUdf = Arc<dyn Fn(&[ArrayRef]) -> 
Result<ArrayRef> + Send + Sync>;
 pub struct ScalarFunction {
     /// Function name
     pub name: String,
-    /// Function argument meta-data
-    pub args: Vec<Field>,
+    /// Set of valid argument types.
+    /// The first dimension (0) represents specific combinations of valid 
argument types
+    /// The second dimension (1) represents the types of each argument.
+    /// For example, [[t1, t2]] is a function of 2 arguments that only accept 
t1 on the first arg and t2 on the second

Review comment:
       I believe that the current API uses `ScalarFunction`:
   
   ```
   ctx.register_udf(ScalarFunction::new(
           "custom_sqrt",
           vec![vec![DataType::Float64]],
           DataType::Float64,
           Arc::new(custom_sqrt),
       ));
   ```
   
   I do not like it, but I was trying not to change it until we land an 
interface to declare UDFs sufficiently generic for our own UDFs with variable 
types.




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

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


Reply via email to