PythonUDF¶
PythonUDF is a Catalyst expression (Spark SQL).
Creating Instance¶
PythonUDF takes the following to be created:
- Name
- PythonFunction
-
DataType(Spark SQL) - Children Catalyst Expressions (Spark SQL)
- Python Eval Type
-
udfDeterministicflag - Result ID (
ExprId)
PythonUDF is created when:
UserDefinedPythonFunctionis requested to builder
Unevaluable¶
PythonUDF is an Unevaluable expression (Spark SQL).
NonSQLExpression¶
PythonUDF is a NonSQLExpression expression (Spark SQL).
UserDefinedExpression¶
PythonUDF is a UserDefinedExpression expression (Spark SQL).
isScalarPythonUDF¶
isScalarPythonUDF(
e: Expression): Boolean
isScalarPythonUDF holds true when the following all hold true:
isScalarPythonUDF is used when:
ExtractPythonUDFFromJoinConditionis requested tohasUnevaluablePythonUDFExtractPythonUDFFromAggregateis requested tohasPythonUdfOverAggregateExtractGroupingPythonUDFFromAggregateis requested tohasScalarPythonUDFExtractPythonUDFsis requested tohasScalarPythonUDF,collectEvaluableUDFs,extract
Scalar PythonUDF Types¶
PythonUDF is scalar for the following eval types:
isGroupedAggPandasUDF¶
isGroupedAggPandasUDF(
e: Expression): Boolean
isGroupedAggPandasUDF is true when the given Expression is a PythonUDF with SQL_GROUPED_AGG_PANDAS_UDF eval type. Otherwise, isGroupedAggPandasUDF is false.