You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: presto-native-execution/src/test/java/com/facebook/presto/nativeworker/AbstractTestNativeGeneralQueries.java
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -997,6 +997,11 @@ public void testBinaryFunctions()
997
997
// crc32.
998
998
assertQuery("SELECT crc32(cast(comment as varbinary)) FROM orders");
999
999
1000
+
// length.
1001
+
assertQuery("SELECT length(cast('' as varbinary))");
1002
+
assertQuery("SELECT length(cast('hello' as varbinary))");
1003
+
assertQuery("SELECT length(cast(comment as varbinary)) FROM orders ORDER BY orderkey LIMIT 10");
1004
+
1000
1005
// from_base64, to_base64.
1001
1006
assertQuery("SELECT from_base64(to_base64(cast(comment as varbinary))) FROM orders");
1002
1007
@@ -1042,7 +1047,9 @@ public void testBinaryFunctions()
1042
1047
// from_hex, to_hex.
1043
1048
assertQuery("SELECT from_hex(to_hex(cast(comment as varbinary))) FROM orders");
1044
1049
1045
-
// hmac_sha1, hmac_sha256, hmac_sha512.
1050
+
// hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512.
1051
+
assertQuery("SELECT hmac_md5(cast(comment as varbinary), cast(clerk as varbinary)) FROM orders ORDER BY orderkey LIMIT 10");
1052
+
assertQuery("SELECT hmac_md5(cast('data' as varbinary), cast('key' as varbinary))");
1046
1053
assertQuery("SELECT hmac_sha1(cast(comment as varbinary), cast(clerk as varbinary)) FROM orders");
1047
1054
assertQuery("SELECT hmac_sha256(cast(comment as varbinary), cast(clerk as varbinary)) FROM orders");
1048
1055
assertQuery("SELECT hmac_sha512(cast(comment as varbinary), cast(clerk as varbinary)) FROM orders");
@@ -1061,6 +1068,22 @@ public void testBinaryFunctions()
1061
1068
1062
1069
// xxhash64.
1063
1070
assertQuery("SELECT xxhash64(cast(comment as varbinary)) FROM orders");
1071
+
assertQuery("SELECT xxhash64(cast('hello' as varbinary), BIGINT '0')");
1072
+
assertQuery("SELECT xxhash64(cast('hello' as varbinary), BIGINT '42')");
1073
+
assertQuery("SELECT xxhash64(cast(comment as varbinary), orderkey) FROM orders ORDER BY orderkey LIMIT 10");
1074
+
1075
+
// lpad, rpad.
1076
+
assertQuery("SELECT lpad(cast('hello' as varbinary), 10, cast('ab' as varbinary))");
1077
+
assertQuery("SELECT lpad(cast('hello' as varbinary), 3, cast('ab' as varbinary))");
1078
+
assertQuery("SELECT lpad(cast(comment as varbinary), 50, cast('x' as varbinary)) FROM orders ORDER BY orderkey LIMIT 10");
1079
+
assertQuery("SELECT rpad(cast('hello' as varbinary), 10, cast('ab' as varbinary))");
1080
+
assertQuery("SELECT rpad(cast('hello' as varbinary), 3, cast('ab' as varbinary))");
1081
+
assertQuery("SELECT rpad(cast(comment as varbinary), 50, cast('x' as varbinary)) FROM orders ORDER BY orderkey LIMIT 10");
1082
+
1083
+
// murmur3_x64_128.
1084
+
assertQuery("SELECT murmur3_x64_128(cast('' as varbinary))", "SELECT from_hex('00000000000000000000000000000000')");
1085
+
assertQuery("SELECT murmur3_x64_128(cast('hashme' as varbinary))", "SELECT from_hex('93192FE805BE23041C8318F67EC4F2BC')");
1086
+
assertQuery("SELECT murmur3_x64_128(cast(comment as varbinary)) FROM orders ORDER BY orderkey LIMIT 10");
1064
1087
1065
1088
// from_base64url, to_base64url
1066
1089
assertQuery("SELECT from_base64url(to_base64url(cast(comment as varbinary))) FROM orders");
0 commit comments