Repository navigation
fix(spanner/spansql): support ARRAY of PROTO types in DDL - #20463
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request fixes operator precedence and return logic in spanner/spansql to correctly handle and format arrays of protobuf and enum types, along with adding corresponding parser and SQL generation tests. The reviewer noted that the explicit break statements introduced in parser.go are redundant in Go's switch blocks and should be removed to keep the code idiomatic.
Comment on lines
+3568
to
+3569
| t.Base = Proto | ||
| return t, nil | ||
| break |
Contributor
machi-genggeng
force-pushed
the
spansql-proto-array
branch
2 times, most recently
from
September 3, 2026 01:30
8a77a02 to
9d29c51
Compare
In `parseBaseOrParameterizedType`, parsing protobuf type identifiers
returned early with `return t, nil`, preventing the parser from
consuming the closing `>` token when `t.Array` was true.
This change:
1. Remove the early returns in `parseBaseOrParameterizedType` so the `expect(">")` check executes for arrays.
2. Updates `Type.SQL()` to allow proto types to receive the `ARRAY<...>`
wrapping when `t.Array` is true.
3. Adds parser and SQL serialization test cases for array proto types.
machi-genggeng
force-pushed
the
spansql-proto-array
branch
from
September 3, 2026 01:31
9d29c51 to
e2b340d
Compare
rahul2393
approved these changes
Sep 9, 2026
sakthivelmanii
approved these changes
Sep 9, 2026
rahul2393
enabled auto-merge (squash)
September 9, 2026 06:54
dbolduc
pushed a commit
that referenced
this pull request
Sep 10, 2026
🤖 I have created a release *beep* *boop* --- ## [1.95.1](spanner/v1.95.0...spanner/v1.95.1) (2026-09-10) ### Bug Fixes * **spanner/spansql:** Support ARRAY of PROTO types in DDL ([#20463](#20463)) ([5fe6a28](5fe6a28)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.
Fixes: #20462
In
parseBaseOrParameterizedType, parsing protobuf type identifiers returned early withreturn t, nil, preventing the parser from consuming the closing>token whent.Arraywas true.This change:
parseBaseOrParameterizedTypeso theexpect(">")check executes for arrays.Type.SQL()to allow proto types to receive theARRAY<...>wrapping whent.Arrayis true.