[SPARK-40414][SQL][PYTHON] More generic type on PythonArrowInput and PythonArrowOutput#37864
Closed
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-40414][SQL][PYTHON] More generic type on PythonArrowInput and PythonArrowOutput#37864HeartSaVioR wants to merge 2 commits intoapache:masterfrom
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
Conversation
… PythonArrowOutput
Contributor
Author
Contributor
Author
|
cc. @HyukjinKwon @ueshin Please take a look, thanks! |
HyukjinKwon
reviewed
Sep 13, 2022
| * Python (Arrow) to JVM (output type being deserialized from ColumnarBatch). | ||
| */ | ||
| private[python] trait PythonArrowOutput { self: BasePythonRunner[_, ColumnarBatch] => | ||
| private[python] trait PythonArrowOutput[OUT <: AnyRef] { self: BasePythonRunner[_, OUT] => |
Member
There was a problem hiding this comment.
qq: should it be <: AnyRef?
Contributor
Author
There was a problem hiding this comment.
We assign null to the OUT type (although that's a trick) hence need to be AnyRef at least if I understand correctly.
HyukjinKwon
reviewed
Sep 13, 2022
| */ | ||
| private[python] trait PythonArrowInput { self: BasePythonRunner[Iterator[InternalRow], _] => | ||
| private[python] trait PythonArrowInput[IN] { self: BasePythonRunner[IN, _] => | ||
| protected val sqlConf = SQLConf.get |
Member
There was a problem hiding this comment.
Seems like we don't need this (in #37863, it's not used too)
Contributor
Author
There was a problem hiding this comment.
Ah OK didn't notice this. Will remove this. Thanks for the pointer.
HyukjinKwon
approved these changes
Sep 13, 2022
ueshin
approved these changes
Sep 13, 2022
Comment on lines
+115
to
+118
| root: VectorSchemaRoot, | ||
| writer: ArrowStreamWriter, | ||
| dataOut: DataOutputStream, | ||
| inputIterator: Iterator[Iterator[InternalRow]]): Unit = { |
65a7576 to
beecc9e
Compare
Contributor
Author
|
I'll merge this PR once build is green. |
Contributor
Author
|
Thanks for reviewing! Merging 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?
This PR proposes to change PythonArrowInput and PythonArrowOutput to be more generic to cover the complex data type on both input and output. This is a baseline work for #37863.
Why are the changes needed?
The traits PythonArrowInput and PythonArrowOutput can be further generalized to cover complex data type on both input and output. E.g. Not all operators would have simple InternalRow as input data to pass to Python worker and vice versa for output data.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests.