From 82ed616feb6db45e2adc8ea6d161ab64b8214fdd Mon Sep 17 00:00:00 2001 From: Austin Liu Date: Sat, 9 Nov 2024 23:56:34 +0800 Subject: [PATCH] Refine tests Signed-off-by: Austin Liu --- .../test_files/string/string_literal.slt | 40 +++++++++++++++++++ .../test_files/string/string_query.slt.part | 17 -------- .../test_files/string/string_view.slt | 11 +---- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/datafusion/sqllogictest/test_files/string/string_literal.slt b/datafusion/sqllogictest/test_files/string/string_literal.slt index 57261470f6eb..30817d9ad131 100644 --- a/datafusion/sqllogictest/test_files/string/string_literal.slt +++ b/datafusion/sqllogictest/test_files/string/string_literal.slt @@ -1623,3 +1623,43 @@ a\_c \%abc false \%abc a\_c false \%abc %abc true \%abc \%abc false +# test utf8, largeutf8, utf8view, DictionaryString for bit_length +query IIII +SELECT + bit_length('Andrew'), + bit_length('datafusion数据融合'), + bit_length('💖'), + bit_length('josé') +; +---- +48 176 32 40 + +query IIII +SELECT + bit_length(arrow_cast('Andrew', 'LargeUtf8')), + bit_length(arrow_cast('datafusion数据融合', 'LargeUtf8')), + bit_length(arrow_cast('💖', 'LargeUtf8')), + bit_length(arrow_cast('josé', 'LargeUtf8')) +; +---- +48 176 32 40 + +query IIII +SELECT + bit_length(arrow_cast('Andrew', 'Utf8View')), + bit_length(arrow_cast('datafusion数据融合', 'Utf8View')), + bit_length(arrow_cast('💖', 'Utf8View')), + bit_length(arrow_cast('josé', 'Utf8View')) +; +---- +48 176 32 40 + +query IIII +SELECT + bit_length(arrow_cast('Andrew', 'Dictionary(Int32, Utf8)')), + bit_length(arrow_cast('datafusion数据融合', 'Dictionary(Int32, Utf8)')), + bit_length(arrow_cast('💖', 'Dictionary(Int32, Utf8)')), + bit_length(arrow_cast('josé', 'Dictionary(Int32, Utf8)')) +; +---- +48 176 32 40 diff --git a/datafusion/sqllogictest/test_files/string/string_query.slt.part b/datafusion/sqllogictest/test_files/string/string_query.slt.part index 51d9c6ef1a8d..f781b9dc33ca 100644 --- a/datafusion/sqllogictest/test_files/string/string_query.slt.part +++ b/datafusion/sqllogictest/test_files/string/string_query.slt.part @@ -1373,20 +1373,3 @@ p percent NULL pan Tadeusz ma iść w kąt pan Tadeusz ma iść w kąt NULL _ _ NULL (empty) (empty) NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL - -# TODO: Support Utf8View for bit_length array string function -# -------------------------------------- -# Test BIT_LENGTH -# -------------------------------------- -# query II -# SELECT -# BIT_LENGTH(ascii_1), -# BIT_LENGTH(unicode_1) -# FROM test_basic_operator; -# ---- -# 48 144 -# 72 176 -# 56 240 -# 88 104 -# 56 216 -# NULL NULL \ No newline at end of file diff --git a/datafusion/sqllogictest/test_files/string/string_view.slt b/datafusion/sqllogictest/test_files/string/string_view.slt index c1b785f549de..ce8a295373aa 100644 --- a/datafusion/sqllogictest/test_files/string/string_view.slt +++ b/datafusion/sqllogictest/test_files/string/string_view.slt @@ -93,16 +93,7 @@ select octet_length(column1_utf8view) from test; 0 NULL -query IIII -SELECT - BIT_LENGTH(arrow_cast('Andrew', 'Utf8View')), - BIT_LENGTH(arrow_cast('datafusion数据融合', 'Utf8View')), - BIT_LENGTH(arrow_cast('💖', 'Utf8View')), - BIT_LENGTH(arrow_cast('josé', 'Utf8View')) -; ----- -48 176 32 40 - +# 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;