[SPARK-56324] Frictionless UDF workers: ZeroCopyByteStream for PySpark message-based communication#55515
Open
sven-weber-db wants to merge 1 commit intoapache:masterfrom
Open
Conversation
84b90de to
dbaec94
Compare
dbaec94 to
caf5e47
Compare
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 is the first in a series of PRs that introduce message-based communication to PySpark UDFs. This initiative is part of SPIP SPARK-55278, which proposes frictionless UDFs.
The goal of introducing message-based communication to PySpark is to:
The overall goal is to introduce a second communication channel while keeping the existing channel intact. Specifically, we want to introduce gRPC in addition to UDS. The existing UDS channel will not be changed, and its characteristics, including performance, will remain untouched.
As the first step to make PySpark communication message-based, this PR introduces a new class, which implements a file-like interface on top of a stream of byte arrays. This class will be used in follow-up PRs to provide raw gRPC-transmitted bytes to PySpark.
Why are the changes needed?
This is the first step toward a language-agnostic UDF protocol for Spark that enables UDF workers written in any language to communicate with the Spark engine through a well-defined specification and API boundary. The abstractions introduced here will be used to make PySpark transport layer agnostic, which is required for PySpark to support the new protocol.
Does this PR introduce any user-facing change?
No. There will be follow-up PRs to consume the introduced abstractions.
How was this patch tested?
New unit tests have been added for the new modules.
Was this patch authored or co-authored using generative AI tooling?
Partially, yes. However, the code is manually reviewed and adjusted.