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-sidecar-plugin/src/test/java/com/facebook/presto/sidecar/NativeSidecarPluginQueryRunnerUtils.java
assertQuery("SELECT array_split_into_chunks(split(comment, ''), 2) from nation");
468
+
assertQuery("SELECT array_least_frequent(quantities) from orders_ex");
469
+
assertQuery("SELECT array_least_frequent(split(comment, ''), 5) from nation");
470
+
assertQuerySucceeds("SELECT array_top_n(ARRAY[orderkey], 25, (x, y) -> if (x < y, cast(1 as bigint), if (x > y, cast(-1 as bigint), cast(0 as bigint)))) from orders");
471
+
472
+
// Map functions
473
+
assertQuerySucceeds("SELECT map_top_n_values(MAP(ARRAY[comment], ARRAY[nationkey]), 2, (x, y) -> if (x < y, cast(1 as bigint), if (x > y, cast(-1 as bigint), cast(0 as bigint)))) from nation");
474
+
assertQuerySucceeds("SELECT map_top_n_keys(MAP(ARRAY[regionkey], ARRAY[nationkey]), 5, (x, y) -> if (x < y, cast(1 as bigint), if (x > y, cast(-1 as bigint), cast(0 as bigint)))) from nation");
@Language("SQL") Stringquery = "select count(1) FROM lineitem l left JOIN orders o ON l.orderkey = o.orderkey JOIN customer c ON o.custkey = c.custkey";
481
+
482
+
assertQuery(query, "select cast(60175 as bigint)");
483
+
assertQuery(sessionWithKeyBasedSampling, query, "select cast(16185 as bigint)");
"SELECT array_split_into_chunks(split(comment, ''), 2) from nation",
498
+
".*Scalar function name not registered: native.default.array_split_into_chunks.*");
499
+
assertQueryFails(session,
500
+
"SELECT array_least_frequent(quantities) from orders_ex",
501
+
".*Scalar function name not registered: native.default.array_least_frequent.*");
502
+
assertQueryFails(session,
503
+
"SELECT array_least_frequent(split(comment, ''), 2) from nation",
504
+
".*Scalar function name not registered: native.default.array_least_frequent.*");
505
+
assertQueryFails(session,
506
+
"SELECT array_top_n(ARRAY[orderkey], 25, (x, y) -> if (x < y, cast(1 as bigint), if (x > y, cast(-1 as bigint), cast(0 as bigint)))) from orders",
507
+
" Scalar function native\\.default\\.array_top_n not registered with arguments.*",
508
+
true);
509
+
510
+
// Map functions
511
+
assertQueryFails(session,
512
+
"SELECT map_top_n_values(MAP(ARRAY[comment], ARRAY[nationkey]), 2, (x, y) -> if (x < y, cast(1 as bigint), if (x > y, cast(-1 as bigint), cast(0 as bigint)))) from nation",
513
+
".*Scalar function native\\.default\\.map_top_n_values not registered with arguments.*",
514
+
true);
515
+
assertQueryFails(session,
516
+
"SELECT map_top_n_keys(MAP(ARRAY[regionkey], ARRAY[nationkey]), 5, (x, y) -> if (x < y, cast(1 as bigint), if (x > y, cast(-1 as bigint), cast(0 as bigint)))) from nation",
517
+
".*Scalar function native\\.default\\.map_top_n_keys not registered with arguments.*",
518
+
true);
519
+
520
+
assertQueryFails(session,
521
+
"select count(1) FROM lineitem l left JOIN orders o ON l.orderkey = o.orderkey JOIN customer c ON o.custkey = c.custkey",
522
+
".*Scalar function name not registered: native.default.key_sampling_percent.*");
0 commit comments