Repository navigation
[SPARK-51079][PYTHON] Support large variable types in pandas UDF, createDataFrame and toPandas with Arrow - #49790
Closed
HyukjinKwon wants to merge 5 commits into
Closed
HyukjinKwon wants to merge 5 commits into
HyukjinKwon wants to merge 5 commits into
Conversation
HyukjinKwon
marked this pull request as draft
February 4, 2025 09:54
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
3 times, most recently
from
February 4, 2025 11:03
8c1328d to
003587d
Compare
Member
Author
|
@Kimahriman FYI |
Member
Author
|
Seems like panads <> Arrow conversion is fixed in their releases |
Member
Author
|
cc @ueshin @zhengruifeng too |
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
3 times, most recently
from
February 4, 2025 12:55
5aacead to
61f2ea2
Compare
ueshin
reviewed
Feb 4, 2025
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
4 times, most recently
from
February 5, 2025 01:18
58c2d84 to
d4d80ff
Compare
zhengruifeng
approved these changes
Feb 5, 2025
Contributor
There was a problem hiding this comment.
nit: probably we can also fetch all configs via py4j in batch in the future.
Contributor
There was a problem hiding this comment.
I feel we are using more and more configs, probably we can also combine them into a runner_conf: Dict[str, str] later
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
from
February 5, 2025 03:09
d4d80ff to
3fe735e
Compare
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
from
February 5, 2025 03:11
3fe735e to
3024d4c
Compare
Member
Author
|
Should be ready to go once it passes |
HyukjinKwon
marked this pull request as ready for review
February 5, 2025 03:12
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
from
February 5, 2025 05:54
e981783 to
e3dfe23
Compare
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
from
February 5, 2025 06:19
e3dfe23 to
484bd01
Compare
HyukjinKwon
force-pushed
the
SPARK-39979-followup2
branch
from
February 5, 2025 23:57
8ea00fd to
4decd33
Compare
Member
Author
|
Merged to master and branch-4.0. |
HyukjinKwon
added a commit
that referenced
this pull request
Feb 5, 2025
…ateDataFrame and toPandas with Arrow ### What changes were proposed in this pull request? This PR is a retry of #41569 that implements to use large variable types within PySpark everywhere. #39572 implemented the core logic but it only supports large variable types in the bold cases below: - `mapInArrow`: **JVM -> Python -> JVM** - Pandas UDF/Function API: **JVM -> Python** -> JVM - createDataFrame with Arrow: Python -> JVM - toPandas with Arrow: JVM -> Python This PR completes them all. ### Why are the changes needed? To consistently support the large variable types. ### Does this PR introduce _any_ user-facing change? `spark.sql.execution.arrow.useLargeVarTypes` is not released out yet so it doesn't affect any end users. ### How was this patch tested? Existing tests with `spark.sql.execution.arrow.useLargeVarTypes` enabled. Closes #49790 from HyukjinKwon/SPARK-39979-followup2. Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]> (cherry picked from commit e2ef5a4) Signed-off-by: Hyukjin Kwon <[email protected]>
HyukjinKwon
pushed a commit
that referenced
this pull request
Apr 7, 2025
…atibility ### What changes were proposed in this pull request? Previously, [PR](#49790) extends ArrowSerializer class to support large variable types in pandas UDF. This PR makes it more backward-compatible by adding a new constructor for cases where the flag for large variable is irrelevant (default to false). ### Why are the changes needed? To achieve versionless in spark connect, we need to be careful about changing a client API in Scala. For example, the change of an interface like this could affect Scala UDF referring to this class (as it is part of the spark connect client package) but running with an older spark connect client. ### How was this patch tested? N/A. It's a new constructor. Closes #50513 from haiyangsun-db/SPARK-51079. Authored-by: Haiyang Sun <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
HyukjinKwon
pushed a commit
that referenced
this pull request
Apr 7, 2025
…atibility ### What changes were proposed in this pull request? Previously, [PR](#49790) extends ArrowSerializer class to support large variable types in pandas UDF. This PR makes it more backward-compatible by adding a new constructor for cases where the flag for large variable is irrelevant (default to false). ### Why are the changes needed? To achieve versionless in spark connect, we need to be careful about changing a client API in Scala. For example, the change of an interface like this could affect Scala UDF referring to this class (as it is part of the spark connect client package) but running with an older spark connect client. ### How was this patch tested? N/A. It's a new constructor. Closes #50513 from haiyangsun-db/SPARK-51079. Authored-by: Haiyang Sun <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]> (cherry picked from commit 75d80c7) Signed-off-by: Hyukjin Kwon <[email protected]>
zifeif2
pushed a commit
to zifeif2/spark
that referenced
this pull request
Nov 14, 2025
…ateDataFrame and toPandas with Arrow ### What changes were proposed in this pull request? This PR is a retry of apache#41569 that implements to use large variable types within PySpark everywhere. apache#39572 implemented the core logic but it only supports large variable types in the bold cases below: - `mapInArrow`: **JVM -> Python -> JVM** - Pandas UDF/Function API: **JVM -> Python** -> JVM - createDataFrame with Arrow: Python -> JVM - toPandas with Arrow: JVM -> Python This PR completes them all. ### Why are the changes needed? To consistently support the large variable types. ### Does this PR introduce _any_ user-facing change? `spark.sql.execution.arrow.useLargeVarTypes` is not released out yet so it doesn't affect any end users. ### How was this patch tested? Existing tests with `spark.sql.execution.arrow.useLargeVarTypes` enabled. Closes apache#49790 from HyukjinKwon/SPARK-39979-followup2. Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]> (cherry picked from commit 454111a) Signed-off-by: Hyukjin Kwon <[email protected]>
zifeif2
pushed a commit
to zifeif2/spark
that referenced
this pull request
Nov 14, 2025
…atibility ### What changes were proposed in this pull request? Previously, [PR](apache#49790) extends ArrowSerializer class to support large variable types in pandas UDF. This PR makes it more backward-compatible by adding a new constructor for cases where the flag for large variable is irrelevant (default to false). ### Why are the changes needed? To achieve versionless in spark connect, we need to be careful about changing a client API in Scala. For example, the change of an interface like this could affect Scala UDF referring to this class (as it is part of the spark connect client package) but running with an older spark connect client. ### How was this patch tested? N/A. It's a new constructor. Closes apache#50513 from haiyangsun-db/SPARK-51079. Authored-by: Haiyang Sun <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]> (cherry picked from commit 0c50c2c) Signed-off-by: Hyukjin Kwon <[email protected]>
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?
This PR is a retry of #41569 that implements to use large variable types within PySpark everywhere.
#39572 implemented the core logic but it only supports large variable types in the bold cases below:
mapInArrow: JVM -> Python -> JVMThis PR completes them all.
Why are the changes needed?
To consistently support the large variable types.
Does this PR introduce any user-facing change?
spark.sql.execution.arrow.useLargeVarTypesis not released out yet so it doesn't affect any end users.How was this patch tested?
Existing tests with
spark.sql.execution.arrow.useLargeVarTypesenabled.