cyberbeam524 commented on code in PR #27788:
URL: https://github.com/apache/datafusion/pull/27788#discussion_r4724859727


##########
datafusion/sqllogictest/test_files/sql_extension_types.slt:
##########
@@ -192,3 +192,83 @@ INSERT INTO t1 VALUES (NULL);
 
 statement ok
 DROP TABLE t1;
+
+statement ok
+CREATE TABLE t (id UUID);
+
+statement ok
+INSERT INTO t VALUES
+  (CAST(arrow_cast(X'00010203040506070809000102030506', 'FixedSizeBinary(16)') 
AS UUID));
+
+# Verify t.id actually has arrow.uuid metadata
+query T
+SELECT arrow_metadata(id, 'ARROW:extension:name') FROM t;
+----
+arrow.uuid
+
+# UNION and UNION ALL between UUID and a bare Binary literal return a planning 
error
+statement error UNION types cannot be unified for column 'id'
+SELECT id FROM t
+UNION
+SELECT X'00010203040506070809000102030507';
+
+statement error UNION types cannot be unified for column 'id'
+SELECT id FROM t
+UNION ALL
+SELECT X'00010203040506070809000102030507';
+
+# Same extension name but different storage type (FixedSizeBinary(16) vs 
Binary) also fails
+statement error UNION types cannot be unified for column 'id'
+SELECT id FROM t
+UNION
+SELECT with_metadata(
+  X'00010203040506070809000102030507',
+  'ARROW:extension:name',
+  'arrow.uuid'
+);
+
+# Same extension name and storage type but different extension payload also 
fails
+statement error UNION types cannot be unified for column 'id'
+SELECT with_metadata(
+  with_metadata(
+    arrow_cast(X'00010203040506070809000102030506', 'FixedSizeBinary(16)'),
+    'ARROW:extension:name',
+    'arrow.uuid'
+  ),
+  'ARROW:extension:metadata',

Review Comment:
   Updated! Switched the metadata test to arrow.fixed_shape_tensor ([2, 5] vs 
[5, 2])



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to