rtpsw commented on code in PR #14682:
URL: https://github.com/apache/arrow/pull/14682#discussion_r1040864675


##########
python/pyarrow/_compute.pyx:
##########
@@ -2678,5 +2831,37 @@ def register_scalar_function(func, function_name, 
function_doc, in_types,
     c_options.input_types = c_in_types
     c_options.output_type = c_out_type
 
-    check_status(RegisterScalarFunction(c_function,
-                                        <function[CallbackUdf]> 
&_scalar_udf_callback, c_options))
+    if func_registry is None:
+        c_func_registry = NULL
+    else:
+        c_func_registry = (<FunctionRegistry>func_registry).registry
+
+    c_register_func = (<RegisterScalarLikeFunction>register_func).register_func
+
+    check_status(c_register_func(c_function,
+                                 <function[CallbackUdf]> &_scalar_udf_callback,
+                                 c_options, c_func_registry))
+
+
+def get_record_batches_from_tabular_function(function_name, 
func_registry=None):

Review Comment:
   > Is this the table UDF equivalent of `call_function`?
   
   I didn't think about it this way, but I guess so. Perhaps this should be 
integrated into `call_function` at some point. In any case, your comment leads 
me to a couple of changes I'd make here:
   - Rename to `call_tabular_function`.
   - Add to the signature an `args` parameter defaulting to `None`, and 
document that for now it is reserved and should be empty. In the future, it 
will be used for passing arguments to the function call.
   
   > In other words, a way to use the function outside of an exec plan?
   
   Yes, that's how I was thinking about it.



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