ClickHouse/dbms/tests/queries/0_stateless/00043_summing_empty_part.sql

18 lines
680 B
MySQL
Raw Normal View History

2014-05-07 11:44:14 +00:00
CREATE DATABASE IF NOT EXISTS test;
DROP TABLE IF EXISTS test.empty_summing;
CREATE TABLE test.empty_summing (d Date, k UInt64, v Int8) ENGINE=SummingMergeTree(d, k, 8192);
INSERT INTO test.empty_summing VALUES ('2015-01-01', 1, 10);
INSERT INTO test.empty_summing VALUES ('2015-01-01', 1, -10);
OPTIMIZE TABLE test.empty_summing;
SELECT * FROM test.empty_summing;
INSERT INTO test.empty_summing VALUES ('2015-01-01', 1, 4),('2015-01-01', 2, -9),('2015-01-01', 3, -14);
INSERT INTO test.empty_summing VALUES ('2015-01-01', 1, -2),('2015-01-01', 1, -2),('2015-01-01', 3, 14);
OPTIMIZE TABLE test.empty_summing;
SELECT * FROM test.empty_summing;
DROP TABLE test.empty_summing;