Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE | POC] feat: Adding support for UUID type #3236

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gauravpurohit06
Copy link
Contributor

feat: Adding support for uuid type.

@gauravpurohit06 gauravpurohit06 requested a review from a team as a code owner August 6, 2024 13:12
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Aug 6, 2024
@@ -94,6 +94,9 @@ private Object writeReplace() {
case PG_NUMERIC:
builder.set(fieldName).to((String) value);
break;
case UUID:
builder.set(fieldName).to((String) value);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this value is from backend as string. Should we be using fromString to convert string value to java.util.UUID value? I don't think this is the right place to do this conversion. May be when customer reads it as UUID then we should use the fromString method.
https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html

@@ -287,6 +296,7 @@ public enum Code {
FLOAT64(TypeCode.FLOAT64, "double precision"),
FLOAT32(TypeCode.FLOAT32, "real"),
STRING(TypeCode.STRING, "character varying"),
UUID(TypeCode.STRING, "uuid"),
Copy link
Contributor

Choose a reason for hiding this comment

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

As per design doc a new TypeCode UUID will be added. This will recognize the input serialized string value as UUID in backend to store it appropriately.

Suggested change
UUID(TypeCode.STRING, "uuid"),
UUID(TypeCode.UUID, "uuid"),

@gauravpurohit06 gauravpurohit06 changed the title feat: Adding support for UUID type [DO NOT MERGE | POC] feat: Adding support for UUID type Aug 13, 2024
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 googleapis/java-spanner API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants