Skip to content

Add Spark 4.0 DataFrame row retrieval support - #1252

Merged
SparkSnail merged 13 commits into
mainfrom
users/shinyang/spark-4_0-support
Sep 8, 2026
Merged

Add Spark 4.0 DataFrame row retrieval support#1252
SparkSnail merged 13 commits into
mainfrom
users/shinyang/spark-4_0-support

Conversation

@SparkSnail

Copy link
Copy Markdown
Contributor

Summary

Adds Spark 4.0.x support for DataFrame.Tail(int) and parameterless ToLocalIterator(), and fixes cleanup when local iteration ends early.

Changes

  • Enable the Spark 4.0.x row retrieval paths while preserving Spark 2/3 version routing.
  • Replace finalizer-based iterator cleanup with deterministic enumerator disposal: drain the active partition and send the stop request before closing the socket.
  • Add unit and E2E coverage for both prefetch settings, empty and multiple partitions, early disposal, cleanup failures, and JVM error propagation.
  • Include the new tests in the Spark 4.0.0–4.0.4 Windows/Linux CI lanes. Applicable Spark 3 tests remain included.

The cleanup fix applies to both Spark 3 and Spark 4 without changing the wire protocol.

Local validation

  • Core unit tests: 193/193 passed.
  • Row retrieval E2E: 8/8 passed on each Windows/Linux combination with Spark 4.0.4 and Spark 3.5.3.
  • Combined Spark 4 compatibility and row retrieval tests: 17/17 passed on Windows.
  • Builds, formatting, and YAML checks passed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@SparkSnail

Copy link
Copy Markdown
Contributor Author

/AzurePipelines run

@SparkSnail
SparkSnail marked this pull request as ready for review September 7, 2026 07:03
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@SparkSnail

Copy link
Copy Markdown
Contributor Author

/AzurePipelines run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@SparkSnail

Copy link
Copy Markdown
Contributor Author

/AzurePipelines run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@SparkSnail
SparkSnail requested review from wudanzy and yipen September 8, 2026 02:37
@SparkSnail
SparkSnail merged commit 583a4aa into main Sep 8, 2026
75 checks passed
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.

2 participants