Skip to content

[SPARK-53097][CONNECT][SQL] Make WriteOperationV2 in SparkConnectPlanner side effect free #51813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

heyihong
Copy link
Contributor

@heyihong heyihong commented Aug 4, 2025

What changes were proposed in this pull request?

This PR refactors the WriteOperationV2 handling in SparkConnectPlanner to make it side-effect free by separating the transformation and execution phases.

Why are the changes needed?

Make WriteOperationV2 side-effect free

Does this PR introduce any user-facing change?

No. This is a purely internal refactoring.

How was this patch tested?

Existing tests (e.g. ReadwriterV2ParityTests)

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Cursor 1.3.9

@HyukjinKwon HyukjinKwon changed the title [SPARK-53097] Make WriteOperationV2 in SparkConnectPlanner side effect free [SPARK-53097][CONNECT] Make WriteOperationV2 in SparkConnectPlanner side effect free Aug 4, 2025
@@ -2660,19 +2660,20 @@ class SparkConnectPlanner(
def process(
command: proto.Command,
responseObserver: StreamObserver[ExecutePlanResponse]): Unit = {
val transformerOpt = transformCommand(command)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heyihong Should unit tests be added to cover the changes in the method process?
The method flow has been significantly altered with new transformation logic and early returns. The PR mentions "Existing tests". Are there existing tests covering the change in the method? If yes, can you please point me to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heyihong heyihong requested a review from violetnspct August 6, 2025 08:47
@heyihong heyihong changed the title [SPARK-53097][CONNECT] Make WriteOperationV2 in SparkConnectPlanner side effect free [SPARK-53097][CONNECT][SQL] Make WriteOperationV2 in SparkConnectPlanner side effect free Aug 6, 2025
@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 70c2008 Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants