james-willis commented on code in PR #1146:
URL: https://github.com/apache/sedona-db/pull/1146#discussion_r3779785420
##########
python/sedonadb/python/sedonadb/context.py:
##########
@@ -444,6 +444,18 @@ def register(self, component: Any, **kwargs: Any) -> None:
- An ExternalFormatSpec implementing a custom datasource type
- An object implementing __sedonadb_extension__(ctx, **kwargs), which
is called with this context and any keyword arguments passed.
+ - A single function object implementing __sedonadb_scalar_udf__(self),
+ which returns a list of PyCapsule objects -- the overload kernels of
+ that one function, each wrapping a natively-compiled
+ SedonaCScalarKernel sharing the function's SQL name -- so real
+ compiled Rust runs per invocation, not a Python callback. Register
+ each function individually. The kernels are grouped into one
+ overloaded UDF; registering under a name already in use, including a
+ built-in's, replaces it, the same as __sedonadb_internal_udf__
already
+ does. Volatility is always Immutable through this protocol; a kernel
+ needing Volatile or Stable should be registered via
+ __sedonadb_internal_udf__ instead, built with
+ sedonadb._lib.sedona_native_scalar_udf(kernels, volatility=...).
Review Comment:
done
--
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]