Package org.apache.datafusion
Class ScalarUdf
java.lang.Object
org.apache.datafusion.ScalarUdf
A scalar UDF registration handle: pairs a
ScalarFunction implementation with the metadata
DataFusion needs to dispatch SQL calls to it.
Mirrors DataFusion's ScalarUDF struct. Construct one from a ScalarFunction via
fromImpl(ScalarFunction) (or the public constructor) and pass it to SessionContext.registerUdf(ScalarUdf).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.arrow.vector.types.pojo.Field>Declared argument fields; cached fromScalarFunction.argFields().static ScalarUdffromImpl(ScalarFunction impl) Equivalent tonew ScalarUdf(impl); mirrors Rust'sScalarUDF::new_from_impl.impl()The wrapped implementation.name()SQL name; cached fromScalarFunction.name().org.apache.arrow.vector.types.pojo.FieldDeclared return field; cached fromScalarFunction.returnField().Volatility classification; cached fromScalarFunction.volatility().
-
Constructor Details
-
ScalarUdf
Wrap aScalarFunctionfor registration. Each metadata getter is invoked once here and cached, so a user impl that allocates per call won't be double-evaluated at registration.- Throws:
NullPointerException- ifimplor any of its declared metadata is null
-
-
Method Details
-
fromImpl
Equivalent tonew ScalarUdf(impl); mirrors Rust'sScalarUDF::new_from_impl. -
impl
The wrapped implementation. -
name
SQL name; cached fromScalarFunction.name(). -
argFields
Declared argument fields; cached fromScalarFunction.argFields(). -
returnField
public org.apache.arrow.vector.types.pojo.Field returnField()Declared return field; cached fromScalarFunction.returnField(). -
volatility
Volatility classification; cached fromScalarFunction.volatility().
-