[SPARK-53658][CONNECT] Accept literal data_type field in ExecutePlanResponse #52405
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?
This PR enable the Spark Connect to support accepting literal
data_type
fields inExecutePlanResponse
messages. The main purpose is to let the server know that the client can accept thedata_type
field in Literal messages, ensuring compatibility with older clients that don't support this new field.Key Changes:
Protocol Buffer Updates:
AcceptResponseOptions
message inbase.proto
withaccept_literal_data_type_field
boolean fieldExecutePlanRequest
to includeaccept_response_options
fieldClient-Side Implementation:
ACCEPT_RESPONSE_OPTIONS
constant inSparkConnectClient.scala
Server-Side Processing:
ExecuteHolder.scala
withacceptLiteralDataTypeField
lazy val to check client capabilitiesSparkConnectPlanExecution.scala
to accept and utilize the new parameterExecuteThreadRunner.scala
to pass the new parameter through the execution chainWhy are the changes needed?
The current Spark Connect implementation needs to handle compatibility between new and old clients regarding the
data_type
field in Literal messages. This enhancement is needed to:data_type
field in Literal messages continue to work without issuesdata_type
field, enabling appropriate response formattingDoes this PR introduce any user-facing change?
No
How was this patch tested?
build/sbt "connect-client-jvm/testOnly *ClientE2ETestSuite -- -z SPARK-53490"
build/sbt "connect/testOnly *SparkConnectServiceSuite"
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor 1.6.42