isidentical commented on code in PR #3765:
URL: https://github.com/apache/arrow-datafusion/pull/3765#discussion_r992528863


##########
datafusion/physical-expr/src/functions.rs:
##########
@@ -253,6 +253,28 @@ macro_rules! invoke_if_unicode_expressions_feature_flag {
 /// decorates a function to handle [`ScalarValue`]s by converting them to 
arrays before calling the function
 /// and vice-versa after evaluation.
 pub fn make_scalar_function<F>(inner: F) -> ScalarFunctionImplementation
+where
+    F: Fn(&[ArrayRef]) -> Result<ArrayRef> + Sync + Send + 'static,
+{
+    make_scalar_function_with_hints(inner, vec![])
+}
+
+/// Just like [`make_scalar_function`], decorates the given function to handle 
both [`ScalarValue`]s and arrays.
+/// Additionally can receive a `hints` vector which can be used to control the 
output arrays when generating them
+/// from [`ScalarValue`]s.
+///
+/// Each element of the `hints` vector gets mapped to the corresponding 
argument of the function. The number of hints
+/// can be less or greater than the number of arguments (for functions with 
variable number of arguments). Each unmapped
+/// argument will assume the default hint.
+///
+/// Hints:

Review Comment:
   I was initially going for a rather simple approach, but I think it makes 
sense to at least use enums, thanks @alamb! 



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