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
select (sum(murmur_hash3_32(ifnull(c0,0))+murmur_hash3_32(ifnull(a,0))+murmur_hash3_32(ifnull(b,0)))) as fingerprint from (select c0,max_by(c2,concat(coalesce(c2,'NULL'),c3)) over(partition by c1) a,min_by(c2,concat(coalesce(c2,'NULL'),c3)) over(partition by c1) b from t0) as t;
353
353
-- result:
354
354
25406211869
355
+
-- !result
356
+
-- name: test_max_min_by_support_window
357
+
CREATE TABLE exam (
358
+
subject_id INT,
359
+
subject STRING,
360
+
exam_result INT
361
+
) DISTRIBUTED BY HASH(`subject_id`) PROPERTIES ("replication_num" = "1");
362
+
-- result:
363
+
-- !result
364
+
insert into exam values
365
+
(1,'math',90),
366
+
(2,'english',70),
367
+
(3,'physics',95),
368
+
(4,'chemistry',85),
369
+
(5,'music',95),
370
+
(6,'biology',null);
371
+
-- result:
372
+
-- !result
373
+
SELECT max_by(subject, exam_result) over(partition by subject_id) FROM exam;
select (sum(murmur_hash3_32(ifnull(__c_0,0))+murmur_hash3_32(ifnull(a,0))+murmur_hash3_32(ifnull(b,0)))) as fingerprint from (select (count(DISTINCT c1)) as __c_0 ,max_by(c2,concat(coalesce(c2,'NULL'),c3)) a,min_by(c2,concat(coalesce(c2,'NULL'),c3)) b from t0) as t;
113
113
select (sum(murmur_hash3_32(ifnull(c2,0))+murmur_hash3_32(ifnull(a,0))+murmur_hash3_32(ifnull(b,0)))) as fingerprint from (select c2,max_by(c0,coalesce(c0,0)*1000+c1) over(partition by c2) a,min_by(c0,coalesce(c0,0)*1000+c1) over(partition by c2) b from t0) as t;
114
114
select (sum(murmur_hash3_32(ifnull(c0,0))+murmur_hash3_32(ifnull(a,0))+murmur_hash3_32(ifnull(b,0)))) as fingerprint from (select c0,max_by(c2,concat(coalesce(c2,'NULL'),c3)) over(partition by c1) a,min_by(c2,concat(coalesce(c2,'NULL'),c3)) over(partition by c1) b from t0) as t;
115
+
116
+
-- name: test_max_min_by_support_window
117
+
CREATE TABLE exam (
118
+
subject_id INT,
119
+
subject STRING,
120
+
exam_result INT
121
+
) DISTRIBUTED BY HASH(`subject_id`) PROPERTIES ("replication_num" = "1");
122
+
123
+
124
+
insert into exam values
125
+
(1,'math',90),
126
+
(2,'english',70),
127
+
(3,'physics',95),
128
+
(4,'chemistry',85),
129
+
(5,'music',95),
130
+
(6,'biology',null);
131
+
132
+
SELECT max_by(subject, exam_result) over(partition by subject_id) FROM exam;
0 commit comments