Apache DataFusion SQL Query Engine
test: improve `sha` function SQL test coverage (#23758)
Yongting You2180253926d8
diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.sltindex 228cce4cfa..ba4e4d03b3 100644--- a/datafusion/sqllogictest/test_files/expr.slt+++ b/datafusion/sqllogictest/test_files/expr.slt@@ -1618,6 +1618,31 @@ SELECT sha224(NULL);----NULL+# sha224 string and binary array inputs+query BBBBBB+SELECT+ sha224(column1) = sha224('tom'),+ sha224(arrow_cast(column1, 'LargeUtf8')) = sha224('tom'),+ sha224(arrow_cast(column1, 'Utf8View')) = sha224('tom'),+ sha224(arrow_cast(column1, 'Binary')) = sha224('tom'),+ sha224(arrow_cast(column1, 'LargeBinary')) = sha224('tom'),+ sha224(arrow_cast(column1, 'BinaryView')) = sha224('tom')+FROM (VALUES ('tom'), (NULL), ('mot')) AS t(column1);+----+true true true true true true+NULL NULL NULL NULL NULL NULL+false false false false false false++# invalid argument count and type+query error DataFusion error:+SELECT sha224();++query error DataFusion error:+SELECT sha224('tom', 'extra');++query error DataFusion error:+SELECT sha224(1);+query ?SELECT digest(NULL,'sha224');----@@ -1678,6 +1703,31 @@ SELECT sha384(NULL);----NULL+# sha384 string and binary array inputs+query BBBBBB+SELECT+ sha384(column1) = sha384('tom'),+ sha384(arrow_cast(column1, 'LargeUtf8')) = sha384('tom'),+ sha384(arrow_cast(column1, 'Utf8View')) = sha384('tom'),+ sha384(arrow_cast(column1, 'Binary')) = sha384('tom'),+ sha384(arrow_cast(column1, 'LargeBinary')) = sha384('tom'),+ sha384(arrow_cast(column1, 'BinaryView')) = sha384('tom')+FROM (VALUES ('tom'), (NULL), ('mot')) AS t(column1);+----+true true true true true true+NULL NULL NULL NULL NULL NULL+false false false false false false++# invalid argument count and type+query error DataFusion error:+SELECT sha384();++query error DataFusion error:+SELECT sha384('tom', 'extra');++query error DataFusion error:+SELECT sha384(1);+query ?SELECT digest(NULL,'sha384');----@@ -1708,6 +1758,31 @@ SELECT sha512(NULL);----NULL+# sha512 string and binary array inputs+query BBBBBB+SELECT+ sha512(column1) = sha512('tom'),+ sha512(arrow_cast(column1, 'LargeUtf8')) = sha512('tom'),+ sha512(arrow_cast(column1, 'Utf8View')) = sha512('tom'),+ sha512(arrow_cast(column1, 'Binary')) = sha512('tom'),+ sha512(arrow_cast(column1, 'LargeBinary')) = sha512('tom'),+ sha512(arrow_cast(column1, 'BinaryView')) = sha512('tom')+FROM (VALUES ('tom'), (NULL), ('mot')) AS t(column1);+----+true true true true true true+NULL NULL NULL NULL NULL NULL+false false false false false false++# invalid argument count and type+query error DataFusion error:+SELECT sha512();++query error DataFusion error:+SELECT sha512('tom', 'extra');++query error DataFusion error:+SELECT sha512(1);+query ?SELECT digest(NULL,'sha512');----