Repository navigation
[SPARK-52215][PYTHON][CONNECT] Implement Scalar Arrow UDF - #50759
Closed
zhengruifeng wants to merge 16 commits into
Closed
zhengruifeng wants to merge 16 commits into
zhengruifeng wants to merge 16 commits into
Conversation
zhengruifeng
force-pushed
the
py_arrow_udf
branch
2 times, most recently
from
May 19, 2025 09:17
c2c5e80 to
de0ca44
Compare
zhengruifeng
marked this pull request as ready for review
May 19, 2025 09:23
zhengruifeng
requested review from
HyukjinKwon,
allisonwang-db,
ueshin and
xinrong-meng
May 19, 2025 09:23
Contributor
Author
|
also cc @asl3 since this might be reused for removing pandas conversion in arrow-optimized UDF |
ueshin
approved these changes
May 19, 2025
Member
There was a problem hiding this comment.
nit: how about using a separate id group, like 250 and above, following the corresponding pandas UDF's eval type, like SQL_GROUPED_MAP_ARROW_UDF = 251?
Member
There was a problem hiding this comment.
nit: +1, or we have "SQL_ARROW_TABLE_UDF = 301", not sure which group is a better fit
Contributor
There was a problem hiding this comment.
How about val SQL_SCALAR_ARROW_UDF = 250
Comment on lines
64
to
67
Member
There was a problem hiding this comment.
This should be ArrowVariadicScalarToScalarFunction?
xinrong-meng
approved these changes
May 19, 2025
Member
|
Added |
asl3
approved these changes
May 19, 2025
zhengruifeng
force-pushed
the
py_arrow_udf
branch
3 times, most recently
from
May 20, 2025 09:04
59e19bf to
199f64f
Compare
zhengruifeng
force-pushed
the
py_arrow_udf
branch
from
May 20, 2025 23:39
199f64f to
6700e84
Compare
Contributor
Author
|
thank you all, merged to master |
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?
Implement Scalar Arrow UDF
Why are the changes needed?
Pandas UDFs (and Pandas Functions like MapInPandas) have a pandas <> arrow conversion, but:
-- The Arrow 13 upgrade, pandas UDFs with data/time types are all broken;
-- Weird behavior when the dataset is empty
StructTypeseries, we needs to usepd.DataFrameas a workaround;Arrow UDF is designed to resolve above issues.
Does this PR introduce any user-facing change?
No, this PR makes the underlying implementation, under
pyspark.sql.pandas.functionswhich is not a public module.So the new feature is not exposed to end users for now, we will need to decide the API later.
How was this patch tested?
new tests
Was this patch authored or co-authored using generative AI tooling?
no