Repository navigation
[SPARK-60069][PYTHON] Migrate SQL_ARROW_UDTF to the EvalTypeHandler pipeline - #59274
Open
Yicong-Huang wants to merge 5 commits into
Open
Yicong-Huang wants to merge 5 commits into
Yicong-Huang wants to merge 5 commits into
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Yicong-Huang
marked this pull request as ready for review
October 9, 2026 08:41
uros-b
reviewed
Oct 11, 2026
uros-b
left a comment
Member
There was a problem hiding this comment.
Looks good to me, thank you @Yicong-Huang! Could you please ping @HyukjinKwon / @zhengruifeng for review too?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Move
SQL_ARROW_UDTFonto the EvalTypeHandler pipeline and lay out the UDTF pieces so the remaining UDTF eval types can follow.read_udtf(AnalyzeResult constructor wrapping, UDTF instantiation incl. PARTITION BY wrapping,evalsignature check) intoread_single_udtf(pickleSer, udtf_info, partition_wrapper), returning(udtf, args_offsets, kwargs_offsets, return_type), the same shape asread_single_udf.read_udtfnow dispatches viaget_eval_type_handlerfirst, likeread_udfs.eval_handlers/_udtf.py:PartitionedUDTF, the base ofUDTFWithPartitionsandArrowUDTFWithPartition(moved out ofread_udtf), holding the shared per-partition UDTF instance, terminate/cleanup andSkipRestOfInputTableExceptionhandling.UDTFEvalTypeHandler, a base handler that runs the eval -> terminate -> cleanup lifecycle and declares thepartition_wrapperthatread_single_udtfapplies, so the prep no longer branches on eval type.ArrowUDTFHandlerforSQL_ARROW_UDTF(BatchEvalTypeHandler+UDTFEvalTypeHandler).build_null_checker, moved out ofread_udtf.wrap_kwargs_supporttoeval_handlers/utils.pyso handlers can use it.SQL_ARROW_TABLE_UDFandSQL_TABLE_UDFstay inread_udtffor 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; existingtest_udtf,test_arrow_udtf, and their Connect parity suites pass. ASVArrowUDTFTimeBench, master vs this PR (median +- stdev of 15 runs, ms):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.