Yicong-Huang opened a new pull request, #59432: URL: https://github.com/apache/spark/pull/59432
### What changes were proposed in this pull request? - Add `TableUDTFHandler` for `SQL_TABLE_UDF` (the pickled Python UDTF). It extends `EvalTypeHandler` directly and keeps the existing serializer, `BatchedSerializer(CPickleSerializer(), 1)`. The `wrap_udtf` / `verify_and_convert_result` / `mapper` logic from `read_udtf` moves into the handler unchanged. - Dispatch every UDF and UDTF eval type through `get_eval_type_handler` in `invoke_udf`: a `UDTFInfo` is read with `read_single_udtf`, a list of `UDFInfo` with `read_single_udf`. Eval types without a handler still go through `read_udfs`. - Remove `read_udtf`. ### Why are the changes needed? Part of SPARK-59415. All three UDTF eval types now run through handlers, so `read_udtf` is no longer needed. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - New unit tests for `TableUDTFHandler` in `test_udtf_eval_type_handlers.py`. - Existing tests: `pyspark.sql.tests.test_udtf`, `pyspark.sql.tests.arrow.test_arrow_udtf`, `pyspark.sql.tests.connect.test_parity_udtf`, `pyspark.tests.test_worker`. - Worker microbenchmark for `SQL_TABLE_UDF` (50k rows, 2 args, `worker.main` on in-memory input, 10 repeats). Output bytes are identical before and after. | UDTF | before (ms) | after (ms) | |---|---|---| | identity | 206.6 +- 8.0 | 195.0 +- 7.0 | | explode x3 | 241.0 +- 5.5 | 232.2 +- 8.0 | | count (terminate only) | 136.2 +- 13.2 | 135.8 +- 7.2 | | stringify | 204.0 +- 5.8 | 196.8 +- 8.8 | ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 This pull request and its description were written by Isaac. -- 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]
