zhengruifeng commented on code in PR #53492:
URL: https://github.com/apache/spark/pull/53492#discussion_r2629422079
##########
python/pyspark/worker.py:
##########
@@ -3280,45 +3280,25 @@ def mapper(a):
df2_vals = table_from_batches(a[1], parsed_offsets[1][1])
return f(df1_keys, df1_vals, df2_keys, df2_vals)
- elif eval_type == PythonEvalType.SQL_GROUPED_AGG_ARROW_ITER_UDF:
- # We assume there is only one UDF here because grouped agg doesn't
- # support combining multiple UDFs.
- assert num_udfs == 1
-
- arg_offsets, f = udfs[0]
-
- # Convert to iterator of batches: Iterator[pa.Array] for single column,
- # or Iterator[Tuple[pa.Array, ...]] for multiple columns
- def mapper(a):
- if len(arg_offsets) == 1:
- batch_iter = (batch_columns[arg_offsets[0]] for batch_columns
in a)
- else:
- batch_iter = (tuple(batch_columns[o] for o in arg_offsets) for
batch_columns in a)
- return f(batch_iter)
-
- elif eval_type == PythonEvalType.SQL_GROUPED_AGG_PANDAS_ITER_UDF:
+ elif eval_type in (
+ PythonEvalType.SQL_GROUPED_AGG_ARROW_ITER_UDF,
+ PythonEvalType.SQL_GROUPED_AGG_PANDAS_ITER_UDF,
+ ):
# We assume there is only one UDF here because grouped agg doesn't
# support combining multiple UDFs.
assert num_udfs == 1
arg_offsets, f = udfs[0]
- # Convert to iterator of pandas Series:
- # - Iterator[pd.Series] for single column
- # - Iterator[Tuple[pd.Series, ...]] for multiple columns
+ # Convert to iterator:
+ # - Arrow: Iterator[pa.Array] or Iterator[Tuple[pa.Array, ...]]
+ # - Pandas: Iterator[pd.Series] or Iterator[Tuple[pd.Series, ...]]
Review Comment:
hmm, I am not a fan of mixing pandas stuffs with arrow stuffs
--
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]