Skip to content

fix(spanner/spannertest): Support UUID as a base data type#14117

Merged
rahul2393 merged 5 commits into
googleapis:mainfrom
adamhicks:adam-adduuidtospansql
May 15, 2026
Merged

fix(spanner/spannertest): Support UUID as a base data type#14117
rahul2393 merged 5 commits into
googleapis:mainfrom
adamhicks:adam-adduuidtospansql

Conversation

@adamhicks

@adamhicks adamhicks commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Fixes: #14506
Currently if we have this ddl statement

CREATE TABLE tname (id UUID) PRIMARY KEY (id)

and we run it through spansql like this:

out, _ := spansql.ParseDDL("", ddl)
ddl = out.List[0].SQL()

we end up with

CREATE TABLE tname (
  id `UUID`,
) PRIMARY KEY(id)

which can no longer be run against the database as the UUID data type has been mangled.

This change proposes to add UUID as a base type so that it can be recognised and retained through parsing.

@adamhicks adamhicks requested review from a team as code owners March 4, 2026 14:54
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Mar 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the UUID data type in spansql, fixing an issue where the type was being mangled during parsing and serialization. The changes correctly introduce UUID as a base type, update the parser and SQL generator, and add corresponding tests. The existing comment in spanner/spannertest/funcs.go has been kept as it provides valid feedback for code clarity and consistency.

Comment thread spanner/spannertest/funcs.go Outdated
@adamhicks

Copy link
Copy Markdown
Contributor Author

@rahul2393 sorry for the ping, but you reviewed this last year. Would you mind taking a look at this PR?

@adamhicks

Copy link
Copy Markdown
Contributor Author

@rahul2393 @quartzmo are either of you able to review this PR? Or able to tag someone else who may be able to help?

@daniel-watson-bumble

Copy link
Copy Markdown

Are there any updates available on this PR and when a review is possible?

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 13, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 13, 2026
@rahul2393

Copy link
Copy Markdown
Contributor

@sakthivelmanii can you please help with second review.

@rahul2393 rahul2393 changed the title fix(spanner): Support UUID as a base data type fix(spanner/spannertest): Support UUID as a base data type May 13, 2026
@rahul2393 rahul2393 enabled auto-merge (squash) May 14, 2026 08:28
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 14, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 14, 2026
@rahul2393

Copy link
Copy Markdown
Contributor

@adamhicks Please fix go vet issues

auto-merge was automatically disabled May 15, 2026 09:06

Head branch was pushed to by a user without write access

@adamhicks

Copy link
Copy Markdown
Contributor Author

@adamhicks Please fix go vet issues

Thanks, done 👍

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 15, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 15, 2026
@rahul2393 rahul2393 merged commit f8b9a93 into googleapis:main May 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spanner/spansql: Cannot handle UUID base type

5 participants