Skip to content

Commit a5d0563

Browse files
authored
Improve the coverage of bit_length testing (#13336)
* improve the testing coverage of bit_length * fix the issue links
1 parent 66180fa commit a5d0563

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

datafusion/sqllogictest/test_files/string/dictionary_utf8.slt

+16
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ _ (empty) false false false false
6464
NULL NULL NULL NULL NULL NULL
6565
NULL NULL NULL NULL NULL NULL
6666

67+
# TODO: move it back to `string_query.slt.part` after fixing the issue
68+
# see issue https://github.com/apache/datafusion/issues/13329
69+
query IIII
70+
select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1), bit_length(unicode_2) from test_basic_operator;
71+
----
72+
48 8 144 32
73+
72 72 176 176
74+
56 8 240 64
75+
88 88 104 256
76+
56 24 216 288
77+
0 8 0 0
78+
8 16 0 0
79+
8 16 0 0
80+
NULL 8 NULL NULL
81+
NULL 8 NULL 32
82+
6783
#
6884
# common test for string-like functions and operators
6985
#

datafusion/sqllogictest/test_files/string/large_string.slt

+16
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,22 @@ _ (empty) false false false false
7171
NULL NULL NULL NULL NULL NULL
7272
NULL NULL NULL NULL NULL NULL
7373

74+
# TODO: move it back to `string_query.slt.part` after fixing the issue
75+
# see issue https://github.com/apache/datafusion/issues/13329
76+
query IIII
77+
select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1), bit_length(unicode_2) from test_basic_operator;
78+
----
79+
48 8 144 32
80+
72 72 176 176
81+
56 8 240 64
82+
88 88 104 256
83+
56 24 216 288
84+
0 8 0 0
85+
8 16 0 0
86+
8 16 0 0
87+
NULL 8 NULL NULL
88+
NULL 8 NULL 32
89+
7490
#
7591
# common test for string-like functions and operators
7692
#

datafusion/sqllogictest/test_files/string/string.slt

+16
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,22 @@ _ \_ (empty) (empty) true false false false
187187
percent p%t pan Tadeusz ma iść w kąt Pan Tadeusz ma frunąć stąd w kąt true false true true
188188
under_score un_____core un iść core chrząszcz na łące w 東京都 true false true false
189189

190+
# TODO: move it back to `string_query.slt.part` after fixing the issue
191+
# see issue https://github.com/apache/datafusion/issues/13329
192+
query IIII
193+
select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1), bit_length(unicode_2) from test_basic_operator;
194+
----
195+
48 8 144 32
196+
72 72 176 176
197+
56 8 240 64
198+
88 88 104 256
199+
56 24 216 288
200+
0 8 0 0
201+
8 16 0 0
202+
8 16 0 0
203+
NULL 8 NULL NULL
204+
NULL 8 NULL 32
205+
190206
#
191207
# Clean up
192208
#

datafusion/sqllogictest/test_files/string/string_view.slt

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ select arrow_cast(col1, 'Utf8View') as c1 from test_substr_base;
3737
statement ok
3838
drop table test_source
3939

40+
# TODO: Revisit this issue after upgrading to the arrow-rs version that includes apache/arrow-rs#6671.
41+
# see issue https://github.com/apache/datafusion/issues/13329
42+
query error DataFusion error: Arrow error: Compute error: bit_length not supported for Utf8View
43+
select bit_length(ascii_1), bit_length(ascii_2), bit_length(unicode_1), bit_length(unicode_2) from test_basic_operator;
44+
4045
#
4146
# common test for string-like functions and operators
4247
#
@@ -93,10 +98,6 @@ select octet_length(column1_utf8view) from test;
9398
0
9499
NULL
95100

96-
# TODO: Revisit this issue after upgrading to the arrow-rs version that includes apache/arrow-rs#6671.
97-
query error DataFusion error: Arrow error: Compute error: bit_length not supported for Utf8View
98-
select bit_length(column1_utf8view) from test;
99-
100101
query T
101102
select btrim(column1_large_utf8) from test;
102103
----

0 commit comments

Comments
 (0)