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/13 15:11:10 UTC

[PR] [SPARK-60218][PYTHON] Migrate SQL_TABLE_UDF to the EvalTypeHandler pipeline and remove read_udtf [spark]

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: 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-60218][PYTHON] Migrate SQL_TABLE_UDF to the EvalTypeHandler pipeline and remove read_udtf [spark]

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

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/18b5254a51f654e808f45ffeddd835bae37859fe
   - merged into branch-4.x https://github.com/apache/spark/commit/0c7ffe0aa812f2ad3a8bec2cbcefbee588578086
   
   *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


Re: [PR] [SPARK-60218][PYTHON] Migrate SQL_TABLE_UDF to the EvalTypeHandler pipeline and remove read_udtf [spark]

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


-- 
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