2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2018-09-03 10:52:44 +00:00
|
|
|
SELECT arrayCumSumNonNegative([1, 2, 3, 4]);
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2018-09-03 10:52:44 +00:00
|
|
|
SELECT arrayCumSumNonNegative([1, -5, 5, -2]);
|
2018-08-31 13:28:35 +00:00
|
|
|
|
|
|
|
SELECT arrayDifference([1, 2, 3, 4]);
|
|
|
|
|
|
|
|
SELECT arrayDifference([1, 7, 100, 5]);
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE test(a Array(Int64), b Array(Float64), c Array(UInt64)) ENGINE=Memory;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO test VALUES ([1, -3, 0, 1], [1.0, 0.4, -0.1], [1, 3, 1]);
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arrayCumSumNonNegative(a) FROM test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arrayCumSumNonNegative(b) FROM test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arrayCumSumNonNegative(c) FROM test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arrayDifference(a) FROM test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arrayDifference(b) FROM test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arrayDifference(c) FROM test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS test;
|
2018-08-31 13:28:35 +00:00
|
|
|
|