LuciferYang commented on code in PR #40581:
URL: https://github.com/apache/spark/pull/40581#discussion_r1151339162
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -482,27 +482,63 @@ class SparkConnectPlanner(val session: SparkSession) {
}
private def transformMapPartitions(rel: proto.MapPartitions): LogicalPlan = {
+ val baseRel = transformRelation(rel.getInput)
val commonUdf = rel.getFunc
- val pythonUdf = transformPythonUDF(commonUdf)
- val isBarrier = if (rel.hasIsBarrier) rel.getIsBarrier else false
- pythonUdf.evalType match {
- case PythonEvalType.SQL_MAP_PANDAS_ITER_UDF =>
- logical.MapInPandas(
- pythonUdf,
- pythonUdf.dataType.asInstanceOf[StructType].toAttributes,
- transformRelation(rel.getInput),
- isBarrier)
- case PythonEvalType.SQL_MAP_ARROW_ITER_UDF =>
- logical.PythonMapInArrow(
- pythonUdf,
- pythonUdf.dataType.asInstanceOf[StructType].toAttributes,
- transformRelation(rel.getInput),
- isBarrier)
+ commonUdf.getFunctionCase match {
+ case proto.CommonInlineUserDefinedFunction.FunctionCase.SCALAR_SCALA_UDF
=>
+ transformTypedMapPartitions(commonUdf, baseRel)
case _ =>
Review Comment:
+1
--
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]