[SPARK-10459] [SQL] Do not need to have ConvertToSafe for PythonUDF
JIRA: https://issues.apache.org/jira/browse/SPARK-10459 As mentioned in the JIRA, `PythonUDF` actually could process `UnsafeRow`. Specially, the rows in `childResults` in `BatchPythonEvaluation` will be projected to a `MutableRow`. So I think we can enable `canProcessUnsafeRows` for `BatchPythonEvaluation` and get rid of redundant `ConvertToSafe`. Author: Liang-Chi Hsieh <viirya@appier.com> Closes #8616 from viirya/pyudf-unsafe.
This commit is contained in:
parent
e51345e1e0
commit
2a508df20d
|
@ -337,6 +337,10 @@ case class BatchPythonEvaluation(udf: PythonUDF, output: Seq[Attribute], child:
|
|||
|
||||
def children: Seq[SparkPlan] = child :: Nil
|
||||
|
||||
override def outputsUnsafeRows: Boolean = false
|
||||
override def canProcessUnsafeRows: Boolean = true
|
||||
override def canProcessSafeRows: Boolean = true
|
||||
|
||||
protected override def doExecute(): RDD[InternalRow] = {
|
||||
val childResults = child.execute().map(_.copy())
|
||||
|
||||
|
|
Loading…
Reference in a new issue