HyukjinKwon commented on code in PR #41316:
URL: https://github.com/apache/spark/pull/41316#discussion_r1224126527
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/python/UserDefinedPythonFunction.scala:
##########
@@ -55,3 +56,36 @@ case class UserDefinedPythonFunction(
}
}
}
+
+/**
+ * A user-defined Python table function. This is used by the Python API.
+ */
+case class UserDefinedPythonTableFunction(
+ name: String,
+ func: PythonFunction,
+ returnType: StructType,
+ udfDeterministic: Boolean) {
+
+ def builder(e: Seq[Expression]): LogicalPlan = {
+ val udtf = PythonUDTF(
+ name = name,
+ func = func,
+ elementSchema = returnType,
+ children = e,
+ udfDeterministic = udfDeterministic)
+ Generate(
+ udtf,
+ unrequiredChildIndex = Nil,
+ outer = false,
+ qualifier = None,
+ generatorOutput = Nil,
+ child = OneRowRelation()
Review Comment:
Is the child always one row relation, or is it temporary?
`BatchEvalPythonUDTFExec` implementation seems like it can take many rows.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]