diff --git a/dbms/tests/queries/0_stateless/00046_stored_aggregates_simple.reference b/dbms/tests/queries/0_stateless/00046_stored_aggregates_simple.reference new file mode 100644 index 00000000000..83b33d238da --- /dev/null +++ b/dbms/tests/queries/0_stateless/00046_stored_aggregates_simple.reference @@ -0,0 +1 @@ +1000 diff --git a/dbms/tests/queries/0_stateless/00046_stored_aggregates_simple.sql b/dbms/tests/queries/0_stateless/00046_stored_aggregates_simple.sql new file mode 100644 index 00000000000..06401ebc589 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00046_stored_aggregates_simple.sql @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS test.stored_aggregates; + +CREATE TABLE test.stored_aggregates +( + d Date, + Uniq AggregateFunction(uniq, UInt64) +) +ENGINE = AggregatingMergeTree(d, d, 8192); + +INSERT INTO test.stored_aggregates +SELECT + toDate('2014-06-01') AS d, + uniqState(number) AS Uniq +FROM +( + SELECT * FROM system.numbers LIMIT 1000 +); + +SELECT uniqMerge(Uniq) FROM test.stored_aggregates; + +DROP TABLE test.stored_aggregates;