Skip to content

Commit 82ed616

Browse files
committed
Refine tests
Signed-off-by: Austin Liu <[email protected]>
1 parent 5d689a1 commit 82ed616

File tree

3 files changed

+41
-27
lines changed

3 files changed

+41
-27
lines changed

datafusion/sqllogictest/test_files/string/string_literal.slt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,3 +1623,43 @@ a\_c \%abc false
16231623
\%abc a\_c false
16241624
\%abc %abc true
16251625
\%abc \%abc false
1626+
# test utf8, largeutf8, utf8view, DictionaryString for bit_length
1627+
query IIII
1628+
SELECT
1629+
bit_length('Andrew'),
1630+
bit_length('datafusion数据融合'),
1631+
bit_length('💖'),
1632+
bit_length('josé')
1633+
;
1634+
----
1635+
48 176 32 40
1636+
1637+
query IIII
1638+
SELECT
1639+
bit_length(arrow_cast('Andrew', 'LargeUtf8')),
1640+
bit_length(arrow_cast('datafusion数据融合', 'LargeUtf8')),
1641+
bit_length(arrow_cast('💖', 'LargeUtf8')),
1642+
bit_length(arrow_cast('josé', 'LargeUtf8'))
1643+
;
1644+
----
1645+
48 176 32 40
1646+
1647+
query IIII
1648+
SELECT
1649+
bit_length(arrow_cast('Andrew', 'Utf8View')),
1650+
bit_length(arrow_cast('datafusion数据融合', 'Utf8View')),
1651+
bit_length(arrow_cast('💖', 'Utf8View')),
1652+
bit_length(arrow_cast('josé', 'Utf8View'))
1653+
;
1654+
----
1655+
48 176 32 40
1656+
1657+
query IIII
1658+
SELECT
1659+
bit_length(arrow_cast('Andrew', 'Dictionary(Int32, Utf8)')),
1660+
bit_length(arrow_cast('datafusion数据融合', 'Dictionary(Int32, Utf8)')),
1661+
bit_length(arrow_cast('💖', 'Dictionary(Int32, Utf8)')),
1662+
bit_length(arrow_cast('josé', 'Dictionary(Int32, Utf8)'))
1663+
;
1664+
----
1665+
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
@@ -1373,20 +1373,3 @@ p percent NULL pan Tadeusz ma iść w kąt pan Tadeusz ma iść w kąt NULL
13731373
_ _ NULL (empty) (empty) NULL
13741374
NULL NULL NULL NULL NULL NULL
13751375
NULL NULL NULL NULL NULL NULL
1376-
1377-
# TODO: Support Utf8View for bit_length array string function
1378-
# --------------------------------------
1379-
# Test BIT_LENGTH
1380-
# --------------------------------------
1381-
# query II
1382-
# SELECT
1383-
# BIT_LENGTH(ascii_1),
1384-
# BIT_LENGTH(unicode_1)
1385-
# FROM test_basic_operator;
1386-
# ----
1387-
# 48 144
1388-
# 72 176
1389-
# 56 240
1390-
# 88 104
1391-
# 56 216
1392-
# NULL NULL

datafusion/sqllogictest/test_files/string/string_view.slt

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

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

0 commit comments

Comments
 (0)