Skip to content

[SPARK-58593][CONNECT] Add extension Any field to AnalyzePlanResponse - #57797

Open
mehdigharam-db wants to merge 1 commit into
apache:masterfrom
mehdigharam-db:SPARK-58593-analyze-plan-response-extension
Open

[SPARK-58593][CONNECT] Add extension Any field to AnalyzePlanResponse#57797
mehdigharam-db wants to merge 1 commit into
apache:masterfrom
mehdigharam-db:SPARK-58593-analyze-plan-response-extension

Conversation

@mehdigharam-db

@mehdigharam-db mehdigharam-db commented Aug 5, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Adds a repeated google.protobuf.Any extensions = 999 field to AnalyzePlanResponse in
base.proto, and regenerates the PySpark stubs accordingly.

The field is placed outside the result oneof, unlike ExecutePlanResponse where the
extension is a oneof arm. This is intentional: AnalyzePlan is a unary RPC that returns a
single response, so a single message must be able to carry both the regular result (e.g.
the schema arm) and an accompanying extension. Putting it inside the oneof would make
the two mutually exclusive.

Why are the changes needed?

To let a Connect provider attach provider-specific metadata to an analyze response, the way
other messages in the protocol already allow.

AnalyzePlanResponse is currently the only major Spark Connect response type without an
extension point. ExecutePlanResponse has one, as do UserContext,
AnalyzePlanRequest.RequestOption, GetStatusRequest and GetStatusResponse. So a
provider that wants to return extra information alongside an analyze result -- schema
metadata, for instance -- has nowhere to put it today, and has to route the information through a separate call.

Does this PR introduce any user-facing change?

No. This adds a new optional proto field that nothing reads or writes yet.

How was this patch tested?

No new tests. This is a proto field addition with no server- or client-side behavior to
exercise.

Verified locally with the same checks the buf CI job runs:

  • dev/check-protos.py -- both pyspark-connect and pyspark-streaming report SUCCESS,
    confirming the committed stubs match the .proto.
  • buf breaking --against '...#branch=branch-4.0,subdir=sql/connect/common/src/main' --
    clean, as expected for adding a new field number.

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

Yes.
Co-authored using Claude Opus 5

@mehdigharam-db
mehdigharam-db marked this pull request as ready for review August 5, 2026 17:22
Adds a `repeated google.protobuf.Any extensions = 999` field to
AnalyzePlanResponse in base.proto, and regenerates the PySpark stubs.

The field is placed outside the `result` oneof (unlike ExecutePlanResponse,
where the extension is a oneof arm). AnalyzePlan is a unary RPC that returns a
single response, so a single message must be able to carry both the regular
result (e.g. the `schema` arm) and an accompanying extension; putting it inside
the oneof would make them mutually exclusive.
@mehdigharam-db
mehdigharam-db force-pushed the SPARK-58593-analyze-plan-response-extension branch from a2adb17 to a327bf0 Compare August 5, 2026 17:29
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