You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Yicong-Huang (via GitHub)" <gi...@apache.org> on 2026/10/07 19:08:34 UTC

[PR] [PYTHON] Dispatch SQL_ARROW_UDTF through an eval type handler [spark]

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-60069][PYTHON] Migrate SQL_ARROW_UDTF to the EvalTypeHandler pipeline [spark]

Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang closed pull request #59274: [SPARK-60069][PYTHON] Migrate SQL_ARROW_UDTF to the EvalTypeHandler pipeline
URL: https://github.com/apache/spark/pull/59274


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-60069][PYTHON] Migrate SQL_ARROW_UDTF to the EvalTypeHandler pipeline [spark]

Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on PR #59274:
URL: https://github.com/apache/spark/pull/59274#issuecomment-6134771496

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/770c6da1f18b898bd2cf591392c1b21ca1934f2f
   - merged into branch-4.x https://github.com/apache/spark/commit/52304917e7b2e09d685e56e30afc64b5c08ae97e
   
   *Posted by `merge_spark_pr.py`*


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org