Kimahriman commented on code in PR #52303:
URL: https://github.com/apache/spark/pull/52303#discussion_r2344293541
##########
python/pyspark/worker.py:
##########
@@ -2222,8 +2224,18 @@ def read_udfs(pickleSer, infile, eval_type):
== "true"
)
_assign_cols_by_name = assign_cols_by_name(runner_conf)
+ arrow_batch_slicing_enabled = (
+
runner_conf.get("spark.sql.execution.arrow.arrowBatchSlicing.enabled",
"true").lower()
+ == "true"
+ )
- if eval_type == PythonEvalType.SQL_COGROUPED_MAP_ARROW_UDF:
+ if eval_type == PythonEvalType.SQL_GROUPED_MAP_PANDAS_UDF and
arrow_batch_slicing_enabled:
+ ser = GroupPandasUDFSerializer(
+ timezone, safecheck, _assign_cols_by_name,
int_to_decimal_coercion_enabled
+ )
+ elif eval_type == PythonEvalType.SQL_GROUPED_MAP_ARROW_UDF and
arrow_batch_slicing_enabled:
+ ser = GroupArrowUDFSerializer(_assign_cols_by_name)
+ elif eval_type == PythonEvalType.SQL_COGROUPED_MAP_ARROW_UDF:
Review Comment:
Why use fully different code paths/serializers for batching/non-batching?
Seems more likely to lead to inconsistencies between the two paths. Isn't
non-batching just a subset of batching where the number of batches is always 1?
This optional behavior seems to add a lot of unnecessary complexity
--
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]