Skip to content

Commit fe442e3

Browse files
committed
Refine tests
Signed-off-by: Austin Liu <[email protected]>
1 parent a168548 commit fe442e3

File tree

3 files changed

+42
-27
lines changed

3 files changed

+42
-27
lines changed

datafusion/sqllogictest/test_files/string/string_literal.slt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,3 +816,44 @@ query B
816816
SELECT starts_with('foobar', 'bar')
817817
----
818818
false
819+
820+
# test utf8, largeutf8, utf8view, DictionaryString for bit_length
821+
query IIII
822+
SELECT
823+
bit_length('Andrew'),
824+
bit_length('datafusion数据融合'),
825+
bit_length('💖'),
826+
bit_length('josé')
827+
;
828+
----
829+
48 176 32 40
830+
831+
query IIII
832+
SELECT
833+
bit_length(arrow_cast('Andrew', 'LargeUtf8')),
834+
bit_length(arrow_cast('datafusion数据融合', 'LargeUtf8')),
835+
bit_length(arrow_cast('💖', 'LargeUtf8')),
836+
bit_length(arrow_cast('josé', 'LargeUtf8'))
837+
;
838+
----
839+
48 176 32 40
840+
841+
query IIII
842+
SELECT
843+
bit_length(arrow_cast('Andrew', 'Utf8View')),
844+
bit_length(arrow_cast('datafusion数据融合', 'Utf8View')),
845+
bit_length(arrow_cast('💖', 'Utf8View')),
846+
bit_length(arrow_cast('josé', 'Utf8View'))
847+
;
848+
----
849+
48 176 32 40
850+
851+
query IIII
852+
SELECT
853+
bit_length(arrow_cast('Andrew', 'Dictionary(Int32, Utf8)')),
854+
bit_length(arrow_cast('datafusion数据融合', 'Dictionary(Int32, Utf8)')),
855+
bit_length(arrow_cast('💖', 'Dictionary(Int32, Utf8)')),
856+
bit_length(arrow_cast('josé', 'Dictionary(Int32, Utf8)'))
857+
;
858+
----
859+
48 176 32 40

datafusion/sqllogictest/test_files/string/string_query.slt.part

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,20 +1096,3 @@ Rapha Raphael NULL datafusionДатаФус datafusionДатаФусион NULL
10961096
und under_score NULL un iść core un iść core NULL
10971097
p percent NULL pan Tadeusz ma iść w kąt pan Tadeusz ma iść w kąt NULL
10981098
NULL NULL NULL NULL NULL NULL
1099-
1100-
# TODO: Support Utf8View for bit_length array string function
1101-
# --------------------------------------
1102-
# Test BIT_LENGTH
1103-
# --------------------------------------
1104-
# query II
1105-
# SELECT
1106-
# BIT_LENGTH(ascii_1),
1107-
# BIT_LENGTH(unicode_1)
1108-
# FROM test_basic_operator;
1109-
# ----
1110-
# 48 144
1111-
# 72 176
1112-
# 56 240
1113-
# 88 104
1114-
# 56 216
1115-
# NULL NULL

datafusion/sqllogictest/test_files/string/string_view.slt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,7 @@ select octet_length(column1_utf8view) from test;
9191
7
9292
NULL
9393

94-
query IIII
95-
SELECT
96-
BIT_LENGTH(arrow_cast('Andrew', 'Utf8View')),
97-
BIT_LENGTH(arrow_cast('datafusion数据融合', 'Utf8View')),
98-
BIT_LENGTH(arrow_cast('💖', 'Utf8View')),
99-
BIT_LENGTH(arrow_cast('josé', 'Utf8View'))
100-
;
101-
----
102-
48 176 32 40
103-
94+
# TODO: Revisit this issue after upgrading to the arrow-rs version that includes apache/arrow-rs#6671.
10495
query error DataFusion error: Arrow error: Compute error: bit_length not supported for Utf8View
10596
select bit_length(column1_utf8view) from test;
10697

0 commit comments

Comments
 (0)