[SPARK-55441][SQL] Types Framework - Phase 1c - Client Integration#54905
Draft
davidm-db wants to merge 8 commits intoapache:masterfrom
Draft
[SPARK-55441][SQL] Types Framework - Phase 1c - Client Integration#54905davidm-db wants to merge 8 commits intoapache:masterfrom
davidm-db wants to merge 8 commits intoapache:masterfrom
Conversation
davidm-db
commented
Mar 20, 2026
sql/api/src/main/scala/org/apache/spark/sql/types/ops/ClientTypeOps.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/ops/TimeTypeApiOps.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/ops/ClientTypeOps.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/ops/ClientTypeOps.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/types/ops/CatalystTypeOps.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/ops/ClientTypeOps.scala
Show resolved
Hide resolved
.../src/main/scala/org/apache/spark/sql/connect/client/arrow/types/ops/TimeTypeConnectOps.scala
Show resolved
Hide resolved
...nect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowDeserializer.scala
Outdated
Show resolved
Hide resolved
...t/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala
Outdated
Show resolved
Hide resolved
davidm-db
commented
Mar 20, 2026
sql/api/src/main/scala/org/apache/spark/sql/util/ArrowUtils.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/execution/arrow/ArrowWriter.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/execution/arrow/ArrowWriter.scala
Show resolved
Hide resolved
...nect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowDeserializer.scala
Outdated
Show resolved
Hide resolved
...onnect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowSerializer.scala
Outdated
Show resolved
Hide resolved
...nnect/common/src/main/scala/org/apache/spark/sql/connect/common/DataTypeProtoConverter.scala
Outdated
Show resolved
Hide resolved
...t/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala
Outdated
Show resolved
Hide resolved
...t/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala
Outdated
Show resolved
Hide resolved
...t/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala
Outdated
Show resolved
Hide resolved
...t/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala
Outdated
Show resolved
Hide resolved
davidm-db
commented
Mar 20, 2026
| Map("typeInfo" -> s"${literalCase.name}(${literalCase.getNumber})")) | ||
| } | ||
| builder.build() | ||
| ProtoTypeOps |
Contributor
Author
There was a problem hiding this comment.
there doesn't seem to be a way to nicely/cleanly reduce the diff here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Extends the Types Framework (Phase 1a: #54223) with optional traits for client-facing infrastructure dispatch. Adds 4 new traits and integrates 13 files so that new framework-managed types get client support automatically — zero edits to infrastructure files.
New traits:
CatalystTypeOps(catalyst) — serializer/deserializer expression building, Arrow field writersClientTypeOps(sql/api) — Arrow conversion, JDBC mapping, Python interop, Hive formatting, Thrift type IDProtoTypeOps(connect/common) — Spark Connect proto DataType and Literal conversionsConnectArrowTypeOps(connect/common) — Connect Arrow serde (no feature flag — client must handle whatever the server sends)TimeType serves as the reference implementation. One new per-type class (
TimeTypeConnectOps) handles both Connect traits; the existingTimeTypeApiOpsandTimeTypeOpsgain mix-insfor
ClientTypeOpsandCatalystTypeOpsrespectively.All changes follow the established
getOrElsepattern — framework dispatch before existing branches, existing code stays as fallback.Why are the changes needed?
Without this, adding a new data type requires manually editing 13+ client integration files with diverse patterns. With these traits, a new type implements the relevant ops methods and all client infrastructure dispatches through the framework automatically.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
The feature flag is enabled by default in test environments (
Utils.isTesting), so the entire existing test suite validates the framework code path. No new tests are added in this PR because the framework delegates to the same underlying logic that existing tests already cover.In subsequent phases, the testing focus will be on:
Was this patch authored or co-authored using generative AI tooling?
Co-authored with: claude-opus-4-6