This is an automated email from the ASF dual-hosted git repository.
goldmedal 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 a5d0563f53 Improve the coverage of `bit_length` testing (#13336)
a5d0563f53 is described below
commit a5d0563f53d05f5589df83d163c91910f51020ba
Author: Jax Liu <[email protected]>
AuthorDate: Thu Nov 14 21:19:00 2024 +0800
Improve the coverage of `bit_length` testing (#13336)
* improve the testing coverage of bit_length
* fix the issue links
---
.../sqllogictest/test_files/string/dictionary_utf8.slt | 16 ++++++++++++++++
.../sqllogictest/test_files/string/large_string.slt | 16 ++++++++++++++++
datafusion/sqllogictest/test_files/string/string.slt | 16 ++++++++++++++++
.../sqllogictest/test_files/string/string_view.slt | 9 +++++----
4 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/datafusion/sqllogictest/test_files/string/dictionary_utf8.slt
b/datafusion/sqllogictest/test_files/string/dictionary_utf8.slt
index d0039f8dcd..c16cfc2ca3 100644
--- a/datafusion/sqllogictest/test_files/string/dictionary_utf8.slt
+++ b/datafusion/sqllogictest/test_files/string/dictionary_utf8.slt
@@ -64,6 +64,22 @@ _ (empty) false false false false
NULL NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
+# TODO: move it back to `string_query.slt.part` after fixing the issue
+# see issue https://github.com/apache/datafusion/issues/13329
+query IIII
+select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1),
bit_length(unicode_2) from test_basic_operator;
+----
+48 8 144 32
+72 72 176 176
+56 8 240 64
+88 88 104 256
+56 24 216 288
+0 8 0 0
+8 16 0 0
+8 16 0 0
+NULL 8 NULL NULL
+NULL 8 NULL 32
+
#
# common test for string-like functions and operators
#
diff --git a/datafusion/sqllogictest/test_files/string/large_string.slt
b/datafusion/sqllogictest/test_files/string/large_string.slt
index 5b738d0041..35fc5694df 100644
--- a/datafusion/sqllogictest/test_files/string/large_string.slt
+++ b/datafusion/sqllogictest/test_files/string/large_string.slt
@@ -71,6 +71,22 @@ _ (empty) false false false false
NULL NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
+# TODO: move it back to `string_query.slt.part` after fixing the issue
+# see issue https://github.com/apache/datafusion/issues/13329
+query IIII
+select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1),
bit_length(unicode_2) from test_basic_operator;
+----
+48 8 144 32
+72 72 176 176
+56 8 240 64
+88 88 104 256
+56 24 216 288
+0 8 0 0
+8 16 0 0
+8 16 0 0
+NULL 8 NULL NULL
+NULL 8 NULL 32
+
#
# common test for string-like functions and operators
#
diff --git a/datafusion/sqllogictest/test_files/string/string.slt
b/datafusion/sqllogictest/test_files/string/string.slt
index 4e173de84f..db2b67d663 100644
--- a/datafusion/sqllogictest/test_files/string/string.slt
+++ b/datafusion/sqllogictest/test_files/string/string.slt
@@ -187,6 +187,22 @@ _ \_ (empty) (empty) true false false false
percent p%t pan Tadeusz ma iść w kąt Pan Tadeusz ma frunąć stąd w kąt true
false true true
under_score un_____core un iść core chrząszcz na łące w 東京都 true false true
false
+# TODO: move it back to `string_query.slt.part` after fixing the issue
+# see issue https://github.com/apache/datafusion/issues/13329
+query IIII
+select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1),
bit_length(unicode_2) from test_basic_operator;
+----
+48 8 144 32
+72 72 176 176
+56 8 240 64
+88 88 104 256
+56 24 216 288
+0 8 0 0
+8 16 0 0
+8 16 0 0
+NULL 8 NULL NULL
+NULL 8 NULL 32
+
#
# Clean up
#
diff --git a/datafusion/sqllogictest/test_files/string/string_view.slt
b/datafusion/sqllogictest/test_files/string/string_view.slt
index 2f4af80a92..2b44c86f52 100644
--- a/datafusion/sqllogictest/test_files/string/string_view.slt
+++ b/datafusion/sqllogictest/test_files/string/string_view.slt
@@ -37,6 +37,11 @@ select arrow_cast(col1, 'Utf8View') as c1 from
test_substr_base;
statement ok
drop table test_source
+# TODO: Revisit this issue after upgrading to the arrow-rs version that
includes apache/arrow-rs#6671.
+# see issue https://github.com/apache/datafusion/issues/13329
+query error DataFusion error: Arrow error: Compute error: bit_length not
supported for Utf8View
+select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1),
bit_length(unicode_2) from test_basic_operator;
+
#
# common test for string-like functions and operators
#
@@ -93,10 +98,6 @@ select octet_length(column1_utf8view) from test;
0
NULL
-# TODO: Revisit this issue after upgrading to the arrow-rs version that
includes apache/arrow-rs#6671.
-query error DataFusion error: Arrow error: Compute error: bit_length not
supported for Utf8View
-select bit_length(column1_utf8view) from test;
-
query T
select btrim(column1_large_utf8) from test;
----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]