Yicong-Huang opened a new pull request, #53239:
URL: https://github.com/apache/spark/pull/53239
### What changes were proposed in this pull request?
This PR separates `SQL_GROUPED_AGG_PANDAS_UDF` and
`SQL_WINDOW_AGG_PANDAS_UDF` into a dedicated serializer
`ArrowStreamAggPandasUDFSerializer`, aligning with the existing
`ArrowStreamAggArrowUDFSerializer` architecture.
### Why are the changes needed?
1. **Input/Output type differences**: Aggregation UDFs
(`SQL_GROUPED_AGG_PANDAS_UDF` and `SQL_WINDOW_AGG_PANDAS_UDF`) have different
input/output types compared to grouped map UDFs:
- Aggregation UDFs: Input is `pd.Series` (entire group/partition), output
is scalar
- Grouped map UDFs: Input is `(keys, vals)` where `vals` is
`pd.DataFrame`, output is `pd.DataFrame`
2. **Multi-UDF support**: Aggregation UDFs support multiple UDFs in a single
projection/aggregation, while grouped map UDFs do not.
### Does this PR introduce _any_ user-facing change?
No. This is an internal refactoring that does not change the public API or
behavior. The serialization logic remains functionally equivalent.
### How was this patch tested?
All existing tests continue to pass, and a new multi-UDF test
(`test_pandas_udf_window.py::WindowPandasUDFTests::test_multiple_udfs`) was
added.
### Was this patch authored or co-authored using generative AI tooling?
No
--
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]