This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new d316702722 Minor: Add FixedSizeBinaryTest (#6895)
d316702722 is described below

commit d316702722e6c301fdb23a9698f7ec415ef548e9
Author: Andrew Lamb <[email protected]>
AuthorDate: Fri Jul 14 15:05:34 2023 -0400

    Minor: Add FixedSizeBinaryTest (#6895)
    
    * Minor: Add FixedSizeBinaryTest
    
    * Update
    
    * update url
---
 .../core/tests/sqllogictests/test_files/binary.slt | 56 +++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/datafusion/core/tests/sqllogictests/test_files/binary.slt 
b/datafusion/core/tests/sqllogictests/test_files/binary.slt
index 5738153a41..ca55ff56cb 100644
--- a/datafusion/core/tests/sqllogictests/test_files/binary.slt
+++ b/datafusion/core/tests/sqllogictests/test_files/binary.slt
@@ -16,7 +16,7 @@
 # under the License.
 
 #############
-## Tests for binary data types
+## Tests for Binary
 #############
 
 # Basic literals encoded as hex
@@ -73,3 +73,57 @@ GROUP BY column1;
 1
 1
 1
+
+statement ok
+drop table t;
+
+#############
+## Tests for FixedSizeBinary
+#############
+
+# fixed_size_binary
+statement ok
+CREATE TABLE t_source
+AS VALUES
+  (X'000102', X'000102'),
+  (X'003102', X'000102'),
+  (NULL,      X'000102'),
+  (X'FF0102', X'000102'),
+  (X'000102', X'000102')
+;
+
+# Create a table with FixedSizeBinary
+statement ok
+CREATE TABLE t
+AS SELECT
+  arrow_cast(column1, 'FixedSizeBinary(3)') as "column1",
+  arrow_cast(column2, 'FixedSizeBinary(3)') as "column2"
+FROM t_source;
+
+query ?T
+SELECT column1, arrow_typeof(column1) FROM t;
+----
+000102 FixedSizeBinary(3)
+003102 FixedSizeBinary(3)
+NULL FixedSizeBinary(3)
+ff0102 FixedSizeBinary(3)
+000102 FixedSizeBinary(3)
+
+# Comparison
+# https://github.com/apache/arrow-rs/pull/4492
+query error DataFusion error: Arrow error: Compute error: eq_dyn_binary_scalar 
only supports Binary or LargeBinary arrays
+SELECT
+  column1,
+  column2,
+  column1 = arrow_cast(X'000102', 'FixedSizeBinary(3)'),
+  column1 = column2
+FROM t
+
+
+# Comparison to different sized field
+query error DataFusion error: Error during planning: Cannot infer common 
argument type for comparison operation FixedSizeBinary\(3\) = 
FixedSizeBinary\(2\)
+SELECT column1, column1 = arrow_cast(X'0102', 'FixedSizeBinary(2)') FROM t
+
+# Comparison to different sized Binary
+query error DataFusion error: Error during planning: Cannot infer common 
argument type for comparison operation FixedSizeBinary\(3\) = Binary
+SELECT column1, column1 = X'0102' FROM t

Reply via email to