Repository navigation
refactor!: use the standard library uuid on Go 1.27 and later - #2766
Merged
laskoviymishka merged 5 commits intoDec 2, 2026
Merged
Conversation
Switch table, view, udf, catalog and cmd, tests included, from
github.com/google/uuid to internal/uuid. internal/uuid/uuid.go is now
the only file in the module that imports google/uuid.
Call sites use only the API that google/uuid and the Go 1.27 standard
library uuid package share. uuid.Nil becomes the zero value
uuid.UUID{}, NewRandom and Must(NewRandom()) become New, NewString
becomes New().String(), and the Version/Variant check on the REST
idempotency key becomes the equivalent tests on bytes 6 and 8.
internal/uuid gains NewV7 for the idempotency key. In tests, NewMD5
values become fixed MustParse literals and the metadata file location
tests check the shape of the path instead of pinning the random source
with SetRand.
No behavior change. iceberg.UUID, internal/uuid.UUID and google/uuid's
UUID are the same type through aliases, so no exported signature
changes.
Signed-off-by: laskoviymishka <[email protected]>
Split internal/uuid by Go version. uuid_google.go keeps today's github.com/google/uuid code behind //go:build !go1.27, and uuid_std.go provides the same names on the standard library uuid package behind //go:build go1.27. On Go 1.27 and later iceberg.UUID is therefore the standard uuid.UUID, and github.com/google/uuid is imported by a single file. arrow-go still names google/uuid in its UUID array, builder and variant APIs, so the sites that cross that boundary convert explicitly instead of relying on the two types being identical. The untagged convert.go adds PassTo, which hands a UUID to a function taking another 16-byte UUID type (variant Builder.AppendUUID), and FromArray, which converts the value held by a variant back to UUID. UUID builders use AppendBytes, and UUIDArray values are converted with iceberg.UUID(...). Without this, the Go 1.27 build fails in variant_bounds.go and variant_residual.go, and UUID variants fail to cast or panic. Behavior is unchanged on both Go versions. Tests that passed arrow-go UUID values or google/uuid-typed builders get the same conversions. On Go 1.27 and later, exported APIs that use iceberg.UUID take the standard library type, which lacks google/uuid methods such as Version, Variant, MarshalBinary, URN and Time. Callers convert a google/uuid value with iceberg.UUID(v). Signed-off-by: laskoviymishka <[email protected]>
laskoviymishka
marked this pull request as ready for review
November 30, 2026 05:21
zeroshade
approved these changes
Nov 30, 2026
zeroshade
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks! This is the swap we planned. I built and vetted with both go1.27.1 (uuid_std.go) and go1.26.8 (uuid_google.go), and the UUID/variant/literal tests in the root, table and table/internal pass on both. The places where UUIDs cross into arrow-go (AppendBytes, iceberg.UUID(arr.Value(...)), PassTo, FromArray) look complete.
This stacks on #2764 and conflicts with main right now, so it'll need a rebase once #2764 lands. A few nits inline.
Signed-off-by: laskoviymishka <[email protected]>
FromArray returns UUID values directly, the package comment moves to doc.go, and uuid_test.go covers FromBytes, NewV7 and FromArray on both builds. Signed-off-by: laskoviymishka <[email protected]>
Signed-off-by: laskoviymishka <[email protected]>
9 of 23 tasks
AynSiddiqui
added a commit
to AynSiddiqui/iceberg-go
that referenced
this pull request
Dec 2, 2026
Follows apache#2766, which moved every google/uuid import behind internal/uuid. Signed-off-by: Ayaan <[email protected]>
AynSiddiqui
added a commit
to AynSiddiqui/iceberg-go
that referenced
this pull request
Dec 2, 2026
Follows apache#2766, which moved every google/uuid import behind internal/uuid. Signed-off-by: Ayaan <[email protected]>
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.
This splits
internal/uuidby Go version:uuid_google.gokeeps the currentgoogle/uuidcode behind//go:build !go1.27, anduuid_std.goexposes the same names on the standard libraryuuidpackage behind//go:build go1.27. On Go 1.27 and latericeberg.UUIDis the standard type, andgithub.com/google/uuidis imported by one file. arrow-go still usesgoogle/uuidin its UUID array, builder and variant APIs, so the places that cross that boundary now convert explicitly, with two small helpers ininternal/uuid/convert.go(PassToandFromArray). Without them the 1.27 build fails and UUID variants stop casting.Checked with
go build ./...,go vet ./...andgo test ./...on Go 1.27.4 and on 1.26.8, so both files are built and tested. The existing UUID literal, variant and arrow round-trip tests cover the conversions on 1.27.On Go 1.27 the standard type has no
Version,Variant,MarshalBinary,URNorTimemethods. Callers holding agoogle/uuidvalue convert it withiceberg.UUID(v). This is noted in the release notes.Part of #2062.