Skip to content

[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
apache:masterfrom
HyukjinKwon:SPARK-60739-reattach-release-dropin-parity
Open

HyukjinKwon wants to merge 1 commit into
apache:masterfrom
HyukjinKwon:SPARK-60739-reattach-release-dropin-parity

Conversation

@HyukjinKwon

@HyukjinKwon HyukjinKwon commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

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 in mapInArrow/mapInPandas schemas, repartitionById(n, "col"), conf.get(key, None), and createDataFrame(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 senderMaxStreamSize to 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.

…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant