Yicong-Huang opened a new pull request, #59274: URL: https://github.com/apache/spark/pull/59274
### What changes were proposed in this pull request? - Extract the shared UDTF prologue of `read_udtf` (AnalyzeResult constructor wrapping, UDTF instantiation incl. PARTITION BY wrappers, `eval` signature check) into `read_single_udtf`, returning `(udtf, args_offsets, kwargs_offsets, return_type)`, the same shape as `read_single_udf`. - Hoist `UDTFWithPartitions`, `ArrowUDTFWithPartition` and `build_null_checker` out of `read_udtf` to module level, unchanged. - `read_udtf` now dispatches via `get_eval_type_handler` first, like `read_udfs`. - Move `SQL_ARROW_UDTF` into a new `ArrowUDTFHandler` (`eval_handlers/_udtf.py`, extending `BatchEvalTypeHandler`); `run()` keeps the existing eval/terminate/cleanup and `SkipRestOfInputTableException` handling. - Move `wrap_kwargs_support` to `eval_handlers/utils.py` so handlers can use it. `SQL_ARROW_TABLE_UDF` and `SQL_TABLE_UDF` stay in `read_udtf` for now. ### Why are the changes needed? Step toward running UDTF and UDF eval types through one handler dispatch path and removing `read_udtf` (SPARK-59415). ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New `test_udtf_eval_type_handlers`; existing `test_udtf`, `test_arrow_udtf`, and their Connect parity suites pass. ASV `ArrowUDTFTimeBench`, master vs this PR (median +- stdev of 15 runs, ms): | scenario | identity | filter | count | |---|---|---|---| | sm_batch_few_col | 0.81+-0.07 -> 0.75+-0.07 | 1.07+-0.03 -> 0.98+-0.04 | 0.62+-0.03 -> 0.55+-0.03 | | lg_batch_many_col | 5.40+-0.16 -> 5.56+-0.28 | 8.15+-0.10 -> 8.21+-0.27 | 1.17+-0.04 -> 1.14+-0.05 | | pure_strings | 2.33+-0.07 -> 2.27+-0.08 | 4.27+-0.10 -> 4.12+-0.09 | 1.24+-0.07 -> 1.16+-0.05 | ### 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]
