mihaibudiu commented on code in PR #4110:
URL: https://github.com/apache/calcite/pull/4110#discussion_r1896236097


##########
core/src/test/resources/sql/misc.iq:
##########
@@ -18,7 +18,75 @@
 !use post
 !set outputformat mysql
 
-# Compared by casting varchar to number
+SELECT UUID '123e4567-e89b-12d3-a456-426655440000';
++--------------------------------------+
+| EXPR$0                               |
++--------------------------------------+
+| 123e4567-e89b-12d3-a456-426655440000 |
++--------------------------------------+
+(1 row)
+
+!ok
+
+SELECT CAST('123e4567-e89b-12d3-a456-426655440000' AS UUID);
++--------------------------------------+
+| EXPR$0                               |
++--------------------------------------+
+| 123e4567-e89b-12d3-a456-426655440000 |
++--------------------------------------+
+(1 row)
+
+!ok
+
+SELECT CAST('123e4567e89b12d3a456426655440000' AS UUID);
+java.lang.IllegalArgumentException: Invalid UUID string: 
123e4567e89b12d3a456426655440000
+!error
+
+SELECT CAST(UUID '123e4567-e89b-12d3-a456-426655440000' AS VARCHAR);
++--------------------------------------+
+| EXPR$0                               |
++--------------------------------------+
+| 123e4567-e89b-12d3-a456-426655440000 |
++--------------------------------------+
+(1 row)
+
+!ok
+
+SELECT CAST(UUID '123e4567-e89b-12d3-a456-426655440000' AS VARBINARY);
++----------------------------------+
+| EXPR$0                           |
++----------------------------------+
+| d3129be867453e1200004455664256a4 |
++----------------------------------+
+(1 row)
+
+!ok
+
+SELECT CAST(x'd3129be867453e1200004455664256a4' AS UUID);
++--------------------------------------+
+| EXPR$0                               |
++--------------------------------------+
+| 123e4567-e89b-12d3-a456-426655440000 |
++--------------------------------------+
+(1 row)
+
+!ok
+
+SELECT CAST(x'00' AS UUID);
+java.lang.IllegalArgumentException: Need at least 16 bytes for UUID
+!error
+
+SELECT UUID '123e4567-e89b-12d3-a456-426655440000' = 
'123e4567-e89b-12d3-a456-426655440000';
++--------+
+| EXPR$0 |
++--------+
+| true   |
++--------+
+(1 row)
+
+!ok
+
+# Compare varchar to number

Review Comment:
   Yes, I wrote that in a recent PR as well. Clearly, this must be an implicit 
cast. I can restore that part, but the phrasing wasn't very good.



-- 
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]

Reply via email to