mihaibudiu commented on code in PR #5191:
URL: https://github.com/apache/calcite/pull/5191#discussion_r3815615654
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -351,9 +351,74 @@ public static String uuidToString(UUID uuid) {
return uuid.toString();
}
+ /** Converts a string to a UUID: 32 hexadecimal digits. All of the following
give
+ * the UUID {@code 123e4567-e89b-12d3-a456-426655440000}:
+ *
+ * <blockquote><pre>
+ * 123e4567-e89b-12d3-a456-426655440000
+ * 123E4567-E89B-12D3-A456-426655440000
+ * 123e4567e89b12d3a456426655440000
+ * {123e4567-e89b-12d3-a456-426655440000}
+ * {123e4567e89b12d3a456426655440000}
+ * 123e-4567-e89b-12d3-a456-4266-5544-0000
+ * 123e4567-e89b12d3-a4564266-55440000
+ * 123e-4567e89b-12d3a456426655440000
+ * </pre></blockquote>
+ *
+ * <p>and each of the following is an error:
+ *
+ * <blockquote><pre>
+ * 1-2-3-4-5 a group is not four digits wide
+ * 123e456-7e89b-12d3-a456-426655440000 as above, though 36 characters long
+ * 123e4567--e89b-12d3-a456-426655440000 empty group
+ * -123e4567e89b12d3a456426655440000 leading hyphen
+ * 123e4567e89b12d3a456426655440000- trailing hyphen
+ * {123e4567-e89b-12d3-a456-426655440000 unbalanced brace
+ * 123e4567-e89b-12d3-a456-42665544000 31 digits
+ * </pre></blockquote>
+ */
+ public static UUID stringToUuid(String s) {
Review Comment:
Will add a test for this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]