pyarrow.compute.register_tabular_function#
- pyarrow.compute.register_tabular_function(func, function_name, function_doc, in_types, out_type, func_registry=None)#
Register a user-defined tabular function.
This API is EXPERIMENTAL.
A tabular function is one accepting a context argument of type UdfContext and returning a generator of struct arrays. The in_types argument must be empty and the out_type argument specifies a schema. Each struct array must have field types corresponding to the schema.
- Parameters:
- func
callable() A callable implementing the user-defined function. The only argument is the context argument of type UdfContext. It must return a callable that returns on each invocation a StructArray matching the out_type, where an empty array indicates end.
- function_name
str Name of the function. There should only be one function registered with this name in the function registry.
- function_doc
dict A dictionary object with keys “summary” (str), and “description” (str).
- in_types
Dict[str,DataType] Must be an empty dictionary (reserved for future use).
- out_type
Union[Schema,DataType] Schema of the function’s output, or a corresponding flat struct type.
- func_registry
FunctionRegistry Optional function registry to use instead of the default global one.
- func