Skip to content

Commit 7bea0ec

Browse files
committed
chore: handle keyProtoToCloudKey in CloudClientExecutor
1 parent 9f63ec4 commit 7bea0ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3282,11 +3282,12 @@ private static com.google.cloud.spanner.Key keyProtoToCloudKey(
32823282
ErrorCode.INVALID_ARGUMENT, "Unsupported key part type: " + type.getCode().name());
32833283
}
32843284
} else if (part.hasStringValue()) {
3285-
// TODO: Handle UUID when it is part of the key.
32863285
if (type.getCode() == TypeCode.NUMERIC) {
32873286
String ascii = part.getStringValue();
32883287
cloudKey.append(new BigDecimal(ascii));
3289-
} else {
3288+
} if (type.getCode() == TypeCode.UUID) {
3289+
cloudKey.append(UUID.fromString(part.getStringValue()));
3290+
}else {
32903291
cloudKey.append(part.getStringValue());
32913292
}
32923293
} else if (part.hasTimestampValue()) {

0 commit comments

Comments
 (0)