Repository navigation
[SPARK-60739][CONNECT] Fix truncated results and unreleased executions in the reattachable stream, and four drop-in parity gaps - #141
Open
HyukjinKwon wants to merge 1 commit into
Conversation
…s in the reattachable stream, and four drop-in parity gaps Reattachable execution (spark-connect-core), mirroring the reference ExecutePlanResponseReattachableIterator of Spark 4.3.0: - Reattach when the server ends the response stream before ResultComplete, which it does on purpose after senderMaxStreamDuration (2m) or senderMaxStreamSize (1g). The stream took that for the end of the result and silently returned a truncated one. - Send ReleaseExecute: ReleaseUntil for each response read, and ReleaseAll once the result is complete, the stream fails, or it is dropped. The server kept every finished execution, with its request and buffered responses, until detachedTimeout or session close. Drop-in parity with PySpark 4.3.0: - StructType.add() updates the base DataType, which mapInArrow/mapInPandas and the grouped applyIn* functions resolve their schema from. - DataFrame.repartitionById(n, "col") takes a string as a column name. - RuntimeConf.get(key, None) returns None for an unset key. - SparkSession.createDataFrame(pyarrow.Table) is supported, converted as the reference client does it. Core additions: SparkSession::create_dataframe_from_arrow and RuntimeConf::get_many. CI starts the e2e servers with a 1 MiB senderMaxStreamSize so that the reattach path is exercised. Co-authored-by: Isaac <no-reply@databricks.com>
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?
The Rust client's reattachable stream now reattaches when the server ends a response stream before the result is complete, and releases executions with
ReleaseExecute, as the reference client does. This also fixes four drop-in gaps against PySpark 4.3.0:StructType.add()fields inmapInArrow/mapInPandasschemas,repartitionById(n, "col"),conf.get(key, None), andcreateDataFrame(pyarrow.Table).Why are the changes needed?
Results were silently truncated whenever the server ended a stream early (by default after 2 minutes or 1 GiB), and the server kept every finished execution until it timed out.
Does this PR introduce any user-facing change?
Yes, these behaviors now match PySpark 4.3.0.
How was this patch tested?
New Rust e2e and Python live-server tests, which fail on master, pass here and against a Spark 4.3.0-rc3 server; CI's e2e servers now use a 1 MiB
senderMaxStreamSizeto exercise the reattach path.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.