Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns a UDFRegistration for UDF registration.
Syntax
udf
Returns
UDFRegistration
Examples
# Register a Python UDF, and use it in SQL.
strlen = spark.udf.register("strlen", lambda x: len(x))
spark.sql("SELECT strlen('test')").show()
# +------------+
# |strlen(test)|
# +------------+
# | 4|
# +------------+