Repository navigation
Conversation
Encode Arrow values with the Spark execution schema so nested field names, decimal precision and timestamp semantics survive JSON serialization. Include column types in the bounded response and document differences from Trino.
cshuo
force-pushed
the
codex/20606-spark-connect-json
branch
from
November 19, 2026 12:42
b16f437 to
9ca0dff
Compare
cshuo
marked this pull request as ready for review
November 19, 2026 12:55
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #20761 +/- ##
=========================================
Coverage 80.87% 80.88%
- Complexity 36135 36144 +9
=========================================
Files 2590 2590
Lines 147760 147760
Branches 18256 18256
=========================================
+ Hits 119500 119511 +11
+ Misses 19985 19971 -14
- Partials 8275 8278 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Describe the issue this Pull Request addresses
Closes #20606.
With the Spark Connect backend,
query_lakehouseloses information when converting collected rows to JSON. Structs lose their field names,TIMESTAMPandTIMESTAMP_NTZboth appear without a UTC offset, and clients cannot distinguish a decimal value such as"1.10"from a string with the same text.Summary and Changelog
feat(gateway): preserve Spark Connect query types in JSON results (
b16f437d901)column_typesin column order, even for empty results, and apply the existing response byte limit to both rows and type metadata.TIMESTAMPas ISO-8601 in UTC with+00:00andTIMESTAMP_NTZas local date and time without an offset.[key, value]pairs so clients can read structured keys.Impact
The response format changes for Spark Connect clients, including MCP clients. For example, a struct previously returned as
["Beijing", "South Station"]now appears as{"city":"Beijing","station":"South Station"}. Clients that accessed named struct fields by position should use field names.Risk Level
Medium. Existing clients may depend on positional struct values or the previous timestamp format. All 797 gateway offline tests passed. On Spark Connect 4.1.3, five live tests passed, including checks for timestamps across a daylight-saving transition and distinct
BIGINTmap keys above JavaScript’s safe integer range. Four tests were skipped because their environment prerequisites were unavailable.Documentation Update
The gateway README documents
column_types, decimal and timestamp encodings, and the JSON differences between Spark Connect and Trino for structs, binary values, and maps.Contributor's checklist