Created
June 2, 2019 19:46
-
-
Save inv2004/c35a43e66d519bba12263dd0a34a4bd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table t1 (k String, v UInt64) ENGINE MergeTree() partition by tuple() ORDER BY k | |
insert into t1 select 'a' as k, number as v from system.numbers limit 5 | |
insert into t1 select 'b' as k, number as v from system.numbers limit 10 | |
select k, arrayCumSum(groupArray(v)) as g from t1 group by k | |
select * from (select k, v, arrayCumSum(groupArray(v) as v) as g from t1 group by k) array join v, g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment