Skip to content

UserDefinedPythonFunction

Creating Instance

UserDefinedPythonFunction takes the following to be created:

  • Name
  • PythonFunction
  • DataType (Spark SQL)
  • Python Eval Type
  • udfDeterministic flag

Creating PythonUDF

builder(
  e: Seq[Expression]): Expression

builder creates a PythonUDF for the arguments and the given children expressions.

builder is used when:

  • UDFRegistration is requested to register a Python UDF (Spark SQL)
  • UserDefinedPythonFunction is requested to apply

Applying PythonUDF

apply(
  exprs: Column*): Column

apply creates a PythonUDF with the input Column (Spark SQL) expressions and creates a new Column.

apply is used when:

  • UDFRegistration is requested to register a Python UDF (Spark SQL)
  • UserDefinedPythonFunction is requested to apply

Last update: 2021-03-03