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/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new c21d025df4 add binary to string_view coercion (#12643)
c21d025df4 is described below
commit c21d025df463ce623f9193c4b24d86141fce81ca
Author: doupache <[email protected]>
AuthorDate: Sat Sep 28 18:36:37 2024 +0800
add binary to string_view coercion (#12643)
---
datafusion/expr-common/src/type_coercion/binary.rs | 4 ++++
datafusion/sqllogictest/test_files/binary_view.slt | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/datafusion/expr-common/src/type_coercion/binary.rs
b/datafusion/expr-common/src/type_coercion/binary.rs
index c1e96a8fa9..e66a9ae1ea 100644
--- a/datafusion/expr-common/src/type_coercion/binary.rs
+++ b/datafusion/expr-common/src/type_coercion/binary.rs
@@ -1052,12 +1052,16 @@ fn binary_to_string_coercion(
match (lhs_type, rhs_type) {
(Binary, Utf8) => Some(Utf8),
(Binary, LargeUtf8) => Some(LargeUtf8),
+ (BinaryView, Utf8) => Some(Utf8View),
+ (BinaryView, LargeUtf8) => Some(LargeUtf8),
(LargeBinary, Utf8) => Some(LargeUtf8),
(LargeBinary, LargeUtf8) => Some(LargeUtf8),
(Utf8, Binary) => Some(Utf8),
(Utf8, LargeBinary) => Some(LargeUtf8),
+ (Utf8, BinaryView) => Some(Utf8View),
(LargeUtf8, Binary) => Some(LargeUtf8),
(LargeUtf8, LargeBinary) => Some(LargeUtf8),
+ (LargeUtf8, BinaryView) => Some(LargeUtf8),
_ => None,
}
}
diff --git a/datafusion/sqllogictest/test_files/binary_view.slt
b/datafusion/sqllogictest/test_files/binary_view.slt
index 77ec77c5ec..f973b909ae 100644
--- a/datafusion/sqllogictest/test_files/binary_view.slt
+++ b/datafusion/sqllogictest/test_files/binary_view.slt
@@ -200,3 +200,18 @@ NULL R NULL NULL NULL NULL
statement ok
drop table test;
+
+statement ok
+create table bv as values
+(
+ arrow_cast('one', 'BinaryView'),
+ arrow_cast('two', 'BinaryView')
+);
+
+query B
+select column1 like 'o%' from bv;
+----
+true
+
+statement ok
+drop table bv;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]