Skip to content

Improve the coverage of bit_length testing #13336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions datafusion/sqllogictest/test_files/string/dictionary_utf8.slt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
16 changes: 16 additions & 0 deletions datafusion/sqllogictest/test_files/string/large_string.slt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
16 changes: 16 additions & 0 deletions datafusion/sqllogictest/test_files/string/string.slt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
9 changes: 5 additions & 4 deletions datafusion/sqllogictest/test_files/string/string_view.slt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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;
----
Expand Down
Loading