viirya commented on a change in pull request #34505:
URL: https://github.com/apache/spark/pull/34505#discussion_r747247868
##########
File path: python/pyspark/worker.py
##########
@@ -364,12 +373,15 @@ def read_udfs(pickleSer, infile, eval_type):
is_scalar_iter = eval_type == PythonEvalType.SQL_SCALAR_PANDAS_ITER_UDF
is_map_iter = eval_type == PythonEvalType.SQL_MAP_PANDAS_ITER_UDF
Review comment:
`is_map_iter` -> `is_map_pandas_iter`?
##########
File path: python/pyspark/sql/pandas/functions.pyi
##########
@@ -149,6 +152,24 @@ def pandas_udf(
f: Union[StructType, str], *, functionType: PandasMapIterUDFType
) -> Callable[[PandasMapIterFunction], MapIterPandasUserDefinedFunction]: ...
@overload
+def pandas_udf(
+ f: ArrowMapIterFunction,
+ returnType: Union[StructType, str],
+ functionType: ArrowMapIterUDFType,
+) -> MapIterArrowUserDefinedFunction: ...
Review comment:
For `ArrowMapIterFunction`, we still name it `pandas_udf`? I think they
are not with Pandas anymore?
##########
File path: python/pyspark/worker.py
##########
@@ -364,12 +373,15 @@ def read_udfs(pickleSer, infile, eval_type):
is_scalar_iter = eval_type == PythonEvalType.SQL_SCALAR_PANDAS_ITER_UDF
is_map_iter = eval_type == PythonEvalType.SQL_MAP_PANDAS_ITER_UDF
+ is_map_arrow_iter = eval_type == PythonEvalType.SQL_MAP_ARROW_ITER_UDF
- if is_scalar_iter or is_map_iter:
+ if is_scalar_iter or is_map_iter or is_map_arrow_iter:
if is_scalar_iter:
assert num_udfs == 1, "One SCALAR_ITER UDF expected here."
if is_map_iter:
assert num_udfs == 1, "One MAP_ITER UDF expected here."
Review comment:
Should it be `MAP_PANDAS_ITER` instead of `MAP_ITER`?
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/python/PythonMapInArrowExec.scala
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.python
+
+import org.apache.spark.api.python.PythonEvalType
+import org.apache.spark.sql.catalyst.expressions._
+import org.apache.spark.sql.execution.SparkPlan
+
+/**
+ * A relation produced by applying a function that takes an iterator of
PyArrow's record batches
+ * and outputs an iterator of PyArrow's record batches.
+ *
+ * This is somewhat similar with [[FlatMapGroupsInPandasExec]] and
+ * `org.apache.spark.sql.catalyst.plans.logical.MapPartitionsInRWithArrow`
+ */
+case class PythonMapInArrowExec(
Review comment:
`MapInArrowExec`?
--
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]