mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Merge pull request #5554 from abyss7/pytest
Run query-tests using pytest framework
This commit is contained in:
commit
20c75dced4
@ -53,6 +53,10 @@ def run_single_test(args, ext, server_logs_level, case_file, stdout_file, stderr
|
||||
while (datetime.now() - start_time).total_seconds() < args.timeout and proc.poll() is None:
|
||||
sleep(0.01)
|
||||
|
||||
# Normalize randomized database names in stdout, stderr files.
|
||||
os.system("sed -i 's/{test_db}/default/g' {file}".format(test_db=args.database, file=stdout_file))
|
||||
os.system("sed -i 's/{test_db}/default/g' {file}".format(test_db=args.database, file=stderr_file))
|
||||
|
||||
stdout = open(stdout_file, 'r').read() if os.path.exists(stdout_file) else ''
|
||||
stdout = unicode(stdout, errors='replace', encoding='utf-8')
|
||||
stderr = open(stderr_file, 'r').read() if os.path.exists(stderr_file) else ''
|
||||
@ -432,7 +436,7 @@ if __name__ == '__main__':
|
||||
parser.add_argument('--testname', action='store_true', default=None, dest='testname', help='Make query with test name before test run')
|
||||
parser.add_argument('--hung-check', action='store_true', default=False)
|
||||
parser.add_argument('--force-color', action='store_true', default=False)
|
||||
parser.add_argument('--database', default='test', help='Default database for tests')
|
||||
parser.add_argument('--database', help='Database for tests (random name test_XXXXXX by default)')
|
||||
parser.add_argument('--parallel', default='1/1', help='One parallel test run number/total')
|
||||
parser.add_argument('-j', '--jobs', default=1, help='Run all tests in parallel', type=int) # default=multiprocessing.cpu_count()
|
||||
|
||||
@ -483,8 +487,14 @@ if __name__ == '__main__':
|
||||
args.client += ' --database=' + os.getenv("CLICKHOUSE_DATABASE")
|
||||
|
||||
args.client_with_database = args.client
|
||||
if args.database:
|
||||
args.client_with_database += ' --database=' + args.database
|
||||
if not args.database:
|
||||
def random_str(length=6):
|
||||
import random
|
||||
import string
|
||||
alphabet = string.ascii_lowercase + string.digits
|
||||
return ''.join(random.choice(alphabet) for _ in range(length))
|
||||
args.database = 'test_{suffix}'.format(suffix=random_str())
|
||||
args.client_with_database += ' --database=' + args.database
|
||||
|
||||
if args.extract_from_config is None:
|
||||
if os.access(args.binary + '-extract-from-config', os.X_OK):
|
||||
|
@ -7,7 +7,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>decimals</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -45,7 +45,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>decimals</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -83,7 +83,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>decimals</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -121,7 +121,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>decimals</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -162,7 +162,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>decimals</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>ints</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -70,7 +70,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>ints</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -133,7 +133,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>ints</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -196,7 +196,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>ints</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -262,7 +262,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>ints</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -35,7 +35,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -63,7 +63,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -91,7 +91,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -122,7 +122,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -153,7 +153,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
@ -184,7 +184,7 @@
|
||||
<port>9000</port>
|
||||
<user>default</user>
|
||||
<password></password>
|
||||
<db>test</db>
|
||||
<db>test_00950</db>
|
||||
<table>strings</table>
|
||||
</clickhouse>
|
||||
</source>
|
||||
|
@ -9,3 +9,4 @@ SELECT s, n.x, n.y FROM nested_test ARRAY JOIN nest AS n;
|
||||
SELECT s, n.x, n.y, nest.x FROM nested_test ARRAY JOIN nest AS n;
|
||||
SELECT s, n.x, n.y, nest.x, nest.y FROM nested_test ARRAY JOIN nest AS n;
|
||||
SELECT s, n.x, n.y, nest.x, nest.y, num FROM nested_test ARRAY JOIN nest AS n, arrayEnumerate(nest.x) AS num;
|
||||
DROP TABLE nested_test;
|
||||
|
@ -1 +1,2 @@
|
||||
253984050
|
||||
253984050
|
||||
|
@ -1,6 +1,7 @@
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.big_array;
|
||||
CREATE TABLE test.big_array (x Array(UInt8)) ENGINE=TinyLog;
|
||||
DROP TABLE IF EXISTS big_array;
|
||||
CREATE TABLE big_array (x Array(UInt8)) ENGINE=TinyLog;
|
||||
SET min_insert_block_size_rows = 0, min_insert_block_size_bytes = 0;
|
||||
INSERT INTO test.big_array SELECT groupArray(number % 255) AS x FROM (SELECT * FROM system.numbers LIMIT 1000000);
|
||||
SELECT sum(y) AS s FROM remote('127.0.0.{2,3}', test, big_array) ARRAY JOIN x AS y;
|
||||
INSERT INTO big_array SELECT groupArray(number % 255) AS x FROM (SELECT * FROM system.numbers LIMIT 1000000);
|
||||
SELECT sum(y) AS s FROM remote('127.0.0.{2,3}', currentDatabase(), big_array) ARRAY JOIN x AS y;
|
||||
SELECT sum(s) FROM (SELECT y AS s FROM remote('127.0.0.{2,3}', currentDatabase(), big_array) ARRAY JOIN x AS y);
|
||||
DROP TABLE big_array;
|
||||
|
@ -1 +0,0 @@
|
||||
253984050
|
@ -1,2 +0,0 @@
|
||||
SELECT sum(s) FROM (SELECT y AS s FROM remote('127.0.0.{2,3}', test, big_array) ARRAY JOIN x AS y);
|
||||
DROP TABLE test.big_array;
|
@ -1,14 +1,14 @@
|
||||
d Date
|
||||
k UInt64
|
||||
i32 Int32
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 10 42
|
||||
d Date
|
||||
k UInt64
|
||||
i32 Int32
|
||||
n.ui8 Array(UInt8)
|
||||
n.s Array(String)
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String)) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String)) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 8 40 [1,2,3] ['12','13','14']
|
||||
2015-01-01 10 42 [] []
|
||||
d Date
|
||||
@ -17,7 +17,7 @@ i32 Int32
|
||||
n.ui8 Array(UInt8)
|
||||
n.s Array(String)
|
||||
n.d Array(Date)
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 7 39 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03']
|
||||
2015-01-01 8 40 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00']
|
||||
2015-01-01 10 42 [] [] []
|
||||
@ -28,7 +28,7 @@ n.ui8 Array(UInt8)
|
||||
n.s Array(String)
|
||||
n.d Array(Date)
|
||||
s String DEFAULT \'0\'
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date), `s` String DEFAULT \'0\') ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date), `s` String DEFAULT \'0\') ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] ['2000-01-01','2000-01-01','2000-01-03'] 100500
|
||||
2015-01-01 7 39 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] 0
|
||||
2015-01-01 8 40 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] 0
|
||||
@ -39,7 +39,7 @@ i32 Int32
|
||||
n.ui8 Array(UInt8)
|
||||
n.s Array(String)
|
||||
s Int64
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `s` Int64) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `s` Int64) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500
|
||||
2015-01-01 7 39 [10,20,30] ['120','130','140'] 0
|
||||
2015-01-01 8 40 [1,2,3] ['12','13','14'] 0
|
||||
@ -51,7 +51,7 @@ n.ui8 Array(UInt8)
|
||||
n.s Array(String)
|
||||
s UInt32
|
||||
n.d Array(Date)
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `s` UInt32, `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `s` UInt32, `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00']
|
||||
2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00']
|
||||
2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00']
|
||||
@ -65,7 +65,7 @@ k UInt64
|
||||
i32 Int32
|
||||
n.s Array(String)
|
||||
s UInt32
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.s` Array(String), `s` UInt32) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `n.s` Array(String), `s` UInt32) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 ['asd','qwe','qwe'] 100500
|
||||
2015-01-01 7 39 ['120','130','140'] 0
|
||||
2015-01-01 8 40 ['12','13','14'] 0
|
||||
@ -74,7 +74,7 @@ d Date
|
||||
k UInt64
|
||||
i32 Int32
|
||||
s UInt32
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `s` UInt32) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `s` UInt32) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 100500
|
||||
2015-01-01 7 39 0
|
||||
2015-01-01 8 40 0
|
||||
@ -85,7 +85,7 @@ i32 Int32
|
||||
s UInt32
|
||||
n.s Array(String)
|
||||
n.d Array(Date)
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `s` UInt32, `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `s` UInt32, `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 100500 [] []
|
||||
2015-01-01 7 39 0 [] []
|
||||
2015-01-01 8 40 0 [] []
|
||||
@ -94,7 +94,7 @@ d Date
|
||||
k UInt64
|
||||
i32 Int32
|
||||
s UInt32
|
||||
CREATE TABLE test.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `s` UInt32) ENGINE = MergeTree(d, k, 8192)
|
||||
CREATE TABLE default.alter_00061 (`d` Date, `k` UInt64, `i32` Int32, `s` UInt32) ENGINE = MergeTree(d, k, 8192)
|
||||
2015-01-01 6 38 100500
|
||||
2015-01-01 7 39 0
|
||||
2015-01-01 8 40 0
|
||||
|
@ -1,71 +1,71 @@
|
||||
DROP TABLE IF EXISTS test.alter_00061;
|
||||
CREATE TABLE test.alter_00061 (d Date, k UInt64, i32 Int32) ENGINE=MergeTree(d, k, 8192);
|
||||
DROP TABLE IF EXISTS alter_00061;
|
||||
CREATE TABLE alter_00061 (d Date, k UInt64, i32 Int32) ENGINE=MergeTree(d, k, 8192);
|
||||
|
||||
INSERT INTO test.alter_00061 VALUES ('2015-01-01', 10, 42);
|
||||
INSERT INTO alter_00061 VALUES ('2015-01-01', 10, 42);
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 ADD COLUMN n Nested(ui8 UInt8, s String);
|
||||
INSERT INTO test.alter_00061 VALUES ('2015-01-01', 8, 40, [1,2,3], ['12','13','14']);
|
||||
ALTER TABLE alter_00061 ADD COLUMN n Nested(ui8 UInt8, s String);
|
||||
INSERT INTO alter_00061 VALUES ('2015-01-01', 8, 40, [1,2,3], ['12','13','14']);
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 ADD COLUMN `n.d` Array(Date);
|
||||
INSERT INTO test.alter_00061 VALUES ('2015-01-01', 7, 39, [10,20,30], ['120','130','140'],['2000-01-01','2000-01-01','2000-01-03']);
|
||||
ALTER TABLE alter_00061 ADD COLUMN `n.d` Array(Date);
|
||||
INSERT INTO alter_00061 VALUES ('2015-01-01', 7, 39, [10,20,30], ['120','130','140'],['2000-01-01','2000-01-01','2000-01-03']);
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 ADD COLUMN s String DEFAULT '0';
|
||||
INSERT INTO test.alter_00061 VALUES ('2015-01-01', 6,38,[10,20,30],['asd','qwe','qwe'],['2000-01-01','2000-01-01','2000-01-03'],'100500');
|
||||
ALTER TABLE alter_00061 ADD COLUMN s String DEFAULT '0';
|
||||
INSERT INTO alter_00061 VALUES ('2015-01-01', 6,38,[10,20,30],['asd','qwe','qwe'],['2000-01-01','2000-01-01','2000-01-03'],'100500');
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 DROP COLUMN `n.d`, MODIFY COLUMN s Int64;
|
||||
ALTER TABLE alter_00061 DROP COLUMN `n.d`, MODIFY COLUMN s Int64;
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 ADD COLUMN `n.d` Array(Date), MODIFY COLUMN s UInt32;
|
||||
ALTER TABLE alter_00061 ADD COLUMN `n.d` Array(Date), MODIFY COLUMN s UInt32;
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
OPTIMIZE TABLE test.alter_00061;
|
||||
OPTIMIZE TABLE alter_00061;
|
||||
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 DROP COLUMN n.ui8, DROP COLUMN n.d;
|
||||
ALTER TABLE alter_00061 DROP COLUMN n.ui8, DROP COLUMN n.d;
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 DROP COLUMN n.s;
|
||||
ALTER TABLE alter_00061 DROP COLUMN n.s;
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 ADD COLUMN n.s Array(String), ADD COLUMN n.d Array(Date);
|
||||
ALTER TABLE alter_00061 ADD COLUMN n.s Array(String), ADD COLUMN n.d Array(Date);
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
ALTER TABLE test.alter_00061 DROP COLUMN n;
|
||||
ALTER TABLE alter_00061 DROP COLUMN n;
|
||||
|
||||
DESC TABLE test.alter_00061;
|
||||
SHOW CREATE TABLE test.alter_00061;
|
||||
SELECT * FROM test.alter_00061 ORDER BY k;
|
||||
DESC TABLE alter_00061;
|
||||
SHOW CREATE TABLE alter_00061;
|
||||
SELECT * FROM alter_00061 ORDER BY k;
|
||||
|
||||
DROP TABLE test.alter_00061;
|
||||
DROP TABLE alter_00061;
|
||||
|
@ -14,3 +14,6 @@ CREATE TABLE check_query_log (N UInt32,S String) Engine = Log;
|
||||
INSERT INTO check_query_log VALUES (1, 'A'), (2, 'B'), (3, 'C')
|
||||
|
||||
CHECK TABLE check_query_log;
|
||||
|
||||
DROP TABLE check_query_log;
|
||||
DROP TABLE check_query_tiny_log;
|
||||
|
@ -125,3 +125,4 @@ CREATE TABLE addresses(addr String) ENGINE = Memory;
|
||||
INSERT INTO addresses(addr) VALUES ('00000000000000000000FFFFC1FC110A'), ('00000000000000000000FFFF4D583737'), ('00000000000000000000FFFF7F000001');
|
||||
SELECT cutIPv6(toFixedString(unhex(addr), 16), 0, 3) FROM addresses ORDER BY addr ASC;
|
||||
|
||||
DROP TABLE addresses;
|
||||
|
@ -39,3 +39,5 @@ INSERT INTO summing (k, s) VALUES (0, 1), (666, 1), (666, 0);
|
||||
OPTIMIZE TABLE summing PARTITION 197001;
|
||||
|
||||
SELECT k, s FROM summing ORDER BY k;
|
||||
|
||||
DROP TABLE summing;
|
||||
|
@ -1,13 +1,13 @@
|
||||
DROP TABLE IF EXISTS test.report1;
|
||||
DROP TABLE IF EXISTS test.report2;
|
||||
DROP TABLE IF EXISTS report1;
|
||||
DROP TABLE IF EXISTS report2;
|
||||
|
||||
CREATE TABLE test.report1(id UInt32, event_date Date, priority UInt32, description String) ENGINE = MergeTree(event_date, intHash32(id), (id, event_date, intHash32(id)), 8192);
|
||||
CREATE TABLE test.report2(id UInt32, event_date Date, priority UInt32, description String) ENGINE = MergeTree(event_date, intHash32(id), (id, event_date, intHash32(id)), 8192);
|
||||
CREATE TABLE report1(id UInt32, event_date Date, priority UInt32, description String) ENGINE = MergeTree(event_date, intHash32(id), (id, event_date, intHash32(id)), 8192);
|
||||
CREATE TABLE report2(id UInt32, event_date Date, priority UInt32, description String) ENGINE = MergeTree(event_date, intHash32(id), (id, event_date, intHash32(id)), 8192);
|
||||
|
||||
INSERT INTO test.report1(id,event_date,priority,description) VALUES (1, '2015-01-01', 1, 'foo')(2, '2015-02-01', 2, 'bar')(3, '2015-03-01', 3, 'foo')(4, '2015-04-01', 4, 'bar')(5, '2015-05-01', 5, 'foo');
|
||||
INSERT INTO test.report2(id,event_date,priority,description) VALUES (1, '2016-01-01', 6, 'bar')(2, '2016-02-01', 7, 'foo')(3, '2016-03-01', 8, 'bar')(4, '2016-04-01', 9, 'foo')(5, '2016-05-01', 10, 'bar');
|
||||
INSERT INTO report1(id,event_date,priority,description) VALUES (1, '2015-01-01', 1, 'foo')(2, '2015-02-01', 2, 'bar')(3, '2015-03-01', 3, 'foo')(4, '2015-04-01', 4, 'bar')(5, '2015-05-01', 5, 'foo');
|
||||
INSERT INTO report2(id,event_date,priority,description) VALUES (1, '2016-01-01', 6, 'bar')(2, '2016-02-01', 7, 'foo')(3, '2016-03-01', 8, 'bar')(4, '2016-04-01', 9, 'foo')(5, '2016-05-01', 10, 'bar');
|
||||
|
||||
SELECT * FROM (SELECT id, event_date, priority, description FROM remote('127.0.0.{2,3}', test, report1) UNION ALL SELECT id, event_date, priority, description FROM remote('127.0.0.{2,3}', test, report2)) ORDER BY id, event_date ASC;
|
||||
SELECT * FROM (SELECT id, event_date, priority, description FROM remote('127.0.0.{2,3}', currentDatabase(), report1) UNION ALL SELECT id, event_date, priority, description FROM remote('127.0.0.{2,3}', currentDatabase(), report2)) ORDER BY id, event_date ASC;
|
||||
|
||||
DROP TABLE test.report1;
|
||||
DROP TABLE test.report2;
|
||||
DROP TABLE report1;
|
||||
DROP TABLE report2;
|
||||
|
@ -2,19 +2,19 @@ SET max_rows_to_group_by = 100000;
|
||||
SET max_block_size = 100001;
|
||||
SET group_by_overflow_mode = 'any';
|
||||
|
||||
DROP TABLE IF EXISTS test.numbers500k;
|
||||
CREATE VIEW test.numbers500k AS SELECT number FROM system.numbers LIMIT 500000;
|
||||
DROP TABLE IF EXISTS numbers500k;
|
||||
CREATE VIEW numbers500k AS SELECT number FROM system.numbers LIMIT 500000;
|
||||
|
||||
SET totals_mode = 'after_having_auto';
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', test, numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
|
||||
SET totals_mode = 'after_having_inclusive';
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', test, numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
|
||||
SET totals_mode = 'after_having_exclusive';
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', test, numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
|
||||
SET totals_mode = 'before_having';
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', test, numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
SELECT intDiv(number, 2) AS k, count(), argMax(toString(number), number) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers500k) GROUP BY k WITH TOTALS ORDER BY k LIMIT 10;
|
||||
|
||||
DROP TABLE test.numbers500k;
|
||||
DROP TABLE numbers500k;
|
||||
|
@ -1,9 +1,9 @@
|
||||
SET max_memory_usage = 100000000;
|
||||
SET max_bytes_before_external_sort = 20000000;
|
||||
|
||||
DROP TABLE IF EXISTS test.numbers10m;
|
||||
CREATE VIEW test.numbers10m AS SELECT number FROM system.numbers LIMIT 10000000;
|
||||
DROP TABLE IF EXISTS numbers10m;
|
||||
CREATE VIEW numbers10m AS SELECT number FROM system.numbers LIMIT 10000000;
|
||||
|
||||
SELECT number FROM remote('127.0.0.{2,3}', test, numbers10m) ORDER BY number * 1234567890123456789 LIMIT 19999980, 20;
|
||||
SELECT number FROM remote('127.0.0.{2,3}', currentDatabase(), numbers10m) ORDER BY number * 1234567890123456789 LIMIT 19999980, 20;
|
||||
|
||||
DROP TABLE test.numbers10m;
|
||||
DROP TABLE numbers10m;
|
||||
|
@ -4,34 +4,34 @@ SELECT '';
|
||||
SELECT length(toString(groupArrayState(toDate(number)))) FROM (SELECT * FROM system.numbers LIMIT 10);
|
||||
SELECT length(toString(groupArrayState(toDateTime(number)))) FROM (SELECT * FROM system.numbers LIMIT 10);
|
||||
|
||||
DROP TABLE IF EXISTS test.numbers_mt;
|
||||
CREATE TABLE test.numbers_mt (number UInt64) ENGINE = Log;
|
||||
INSERT INTO test.numbers_mt SELECT * FROM system.numbers LIMIT 1, 1000000;
|
||||
DROP TABLE IF EXISTS numbers_mt;
|
||||
CREATE TABLE numbers_mt (number UInt64) ENGINE = Log;
|
||||
INSERT INTO numbers_mt SELECT * FROM system.numbers LIMIT 1, 1000000;
|
||||
|
||||
SELECT count(), sum(ns), max(ns) FROM (SELECT intDiv(number, 100) AS k, groupArray(number) AS ns FROM test.numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns)), max(toUInt64(ns)) FROM (SELECT intDiv(number, 100) AS k, groupArray(toString(number)) AS ns FROM test.numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns[1])), max(toUInt64(ns[1])), sum(toUInt64(ns[2]))/10 FROM (SELECT intDiv(number, 100) AS k, groupArray([toString(number), toString(number*10)]) AS ns FROM test.numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(ns[1]), max(ns[1]), sum(ns[2])/10 FROM (SELECT intDiv(number, 100) AS k, groupArray([number, number*10]) AS ns FROM test.numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(ns), max(ns) FROM (SELECT intDiv(number, 100) AS k, groupArray(number) AS ns FROM numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns)), max(toUInt64(ns)) FROM (SELECT intDiv(number, 100) AS k, groupArray(toString(number)) AS ns FROM numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns[1])), max(toUInt64(ns[1])), sum(toUInt64(ns[2]))/10 FROM (SELECT intDiv(number, 100) AS k, groupArray([toString(number), toString(number*10)]) AS ns FROM numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(ns[1]), max(ns[1]), sum(ns[2])/10 FROM (SELECT intDiv(number, 100) AS k, groupArray([number, number*10]) AS ns FROM numbers_mt GROUP BY k) ARRAY JOIN ns;
|
||||
|
||||
SELECT count(), sum(ns), max(ns) FROM (SELECT intDiv(number, 100) AS k, groupArray(number) AS ns FROM remote('127.0.0.{2,3}', 'test', 'numbers_mt') GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns)), max(toUInt64(ns)) FROM (SELECT intDiv(number, 100) AS k, groupArray(toString(number)) AS ns FROM remote('127.0.0.{2,3}', 'test', 'numbers_mt') GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns[1])), max(toUInt64(ns[1])), sum(toUInt64(ns[2]))/10 FROM (SELECT intDiv(number, 100) AS k, groupArray([toString(number), toString(number*10)]) AS ns FROM remote('127.0.0.{2,3}', 'test', 'numbers_mt') GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(ns), max(ns) FROM (SELECT intDiv(number, 100) AS k, groupArray(number) AS ns FROM remote('127.0.0.{2,3}', currentDatabase(), 'numbers_mt') GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns)), max(toUInt64(ns)) FROM (SELECT intDiv(number, 100) AS k, groupArray(toString(number)) AS ns FROM remote('127.0.0.{2,3}', currentDatabase(), 'numbers_mt') GROUP BY k) ARRAY JOIN ns;
|
||||
SELECT count(), sum(toUInt64(ns[1])), max(toUInt64(ns[1])), sum(toUInt64(ns[2]))/10 FROM (SELECT intDiv(number, 100) AS k, groupArray([toString(number), toString(number*10)]) AS ns FROM remote('127.0.0.{2,3}', currentDatabase(), 'numbers_mt') GROUP BY k) ARRAY JOIN ns;
|
||||
|
||||
DROP TABLE test.numbers_mt;
|
||||
CREATE TABLE test.numbers_mt (number UInt64) ENGINE = Log;
|
||||
INSERT INTO test.numbers_mt SELECT * FROM system.numbers LIMIT 1, 1048575;
|
||||
DROP TABLE numbers_mt;
|
||||
CREATE TABLE numbers_mt (number UInt64) ENGINE = Log;
|
||||
INSERT INTO numbers_mt SELECT * FROM system.numbers LIMIT 1, 1048575;
|
||||
|
||||
SELECT '';
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(number AS i)), length(groupArray(1024)(i)), length(groupArray(65536)(i)) AS s FROM test.numbers_mt GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(hex(number) AS i)), length(groupArray(1024)(i)), length(groupArray(65536)(i)) AS s FROM test.numbers_mt GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)([hex(number)] AS i)), length(groupArray(1024)(i)), length(groupArray(65536)(i)) AS s FROM test.numbers_mt GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(number AS i)), length(groupArray(1024)(i)), length(groupArray(65536)(i)) AS s FROM numbers_mt GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(hex(number) AS i)), length(groupArray(1024)(i)), length(groupArray(65536)(i)) AS s FROM numbers_mt GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)([hex(number)] AS i)), length(groupArray(1024)(i)), length(groupArray(65536)(i)) AS s FROM numbers_mt GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
|
||||
SELECT '';
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(number AS i)), length(groupArray(1500)(i)), length(groupArray(70000)(i)) AS s FROM remote('127.0.0.{2,3}', 'test', 'numbers_mt') GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(hex(number) AS i)), length(groupArray(1500)(i)), length(groupArray(70000)(i)) AS s FROM remote('127.0.0.{2,3}', 'test', 'numbers_mt') GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)([hex(number)] AS i)), length(groupArray(1500)(i)), length(groupArray(70000)(i)) AS s FROM remote('127.0.0.{2,3}', 'test', 'numbers_mt') GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(number AS i)), length(groupArray(1500)(i)), length(groupArray(70000)(i)) AS s FROM remote('127.0.0.{2,3}', currentDatabase(), 'numbers_mt') GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)(hex(number) AS i)), length(groupArray(1500)(i)), length(groupArray(70000)(i)) AS s FROM remote('127.0.0.{2,3}', currentDatabase(), 'numbers_mt') GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
SELECT roundToExp2(number) AS k, length(groupArray(1)([hex(number)] AS i)), length(groupArray(1500)(i)), length(groupArray(70000)(i)) AS s FROM remote('127.0.0.{2,3}', currentDatabase(), 'numbers_mt') GROUP BY k ORDER BY k LIMIT 9, 11;
|
||||
|
||||
DROP TABLE test.numbers_mt;
|
||||
DROP TABLE numbers_mt;
|
||||
|
||||
-- Check binary compatibility:
|
||||
-- clickhouse-client -h old -q "SELECT arrayReduce('groupArrayState', [['1'], ['22'], ['333']]) FORMAT RowBinary" | clickhouse-local -s --input-format RowBinary --structure "d AggregateFunction(groupArray2, Array(String))" -q "SELECT groupArray2Merge(d) FROM table"
|
||||
|
@ -1,9 +1,7 @@
|
||||
DROP TABLE IF EXISTS test.set;
|
||||
DROP TABLE IF EXISTS test.set2;
|
||||
DROP TABLE IF EXISTS set;
|
||||
DROP TABLE IF EXISTS set2;
|
||||
|
||||
CREATE TABLE test.set (x String) ENGINE = Set;
|
||||
|
||||
USE test;
|
||||
CREATE TABLE set (x String) ENGINE = Set;
|
||||
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s NOT IN set;
|
||||
@ -14,10 +12,10 @@ SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s
|
||||
RENAME TABLE set TO set2;
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
||||
|
||||
INSERT INTO test.set2 VALUES ('Hello'), ('World');
|
||||
INSERT INTO set2 VALUES ('Hello'), ('World');
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
||||
|
||||
INSERT INTO test.set2 VALUES ('abc'), ('World');
|
||||
INSERT INTO set2 VALUES ('abc'), ('World');
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
||||
|
||||
DETACH TABLE set2;
|
||||
@ -28,6 +26,4 @@ SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s
|
||||
RENAME TABLE set2 TO set;
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
|
||||
|
||||
USE default;
|
||||
|
||||
DROP TABLE test.set;
|
||||
DROP TABLE set;
|
||||
|
@ -1,15 +1,11 @@
|
||||
DROP TABLE IF EXISTS test.join;
|
||||
DROP TABLE IF EXISTS join;
|
||||
|
||||
CREATE TABLE test.join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k);
|
||||
CREATE TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k);
|
||||
|
||||
USE test;
|
||||
|
||||
INSERT INTO test.join VALUES (1, 'abc'), (2, 'def');
|
||||
INSERT INTO join VALUES (1, 'abc'), (2, 'def');
|
||||
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) ANY LEFT JOIN join USING k;
|
||||
|
||||
INSERT INTO test.join VALUES (6, 'ghi');
|
||||
INSERT INTO join VALUES (6, 'ghi');
|
||||
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) ANY LEFT JOIN join USING k;
|
||||
|
||||
USE default;
|
||||
|
||||
DROP TABLE test.join;
|
||||
DROP TABLE join;
|
||||
|
@ -1,11 +1,10 @@
|
||||
SET max_parallel_replicas = 2;
|
||||
|
||||
DROP TABLE IF EXISTS test.report;
|
||||
DROP TABLE IF EXISTS report;
|
||||
|
||||
CREATE TABLE test.report(id UInt32, event_date Date, priority UInt32, description String) ENGINE = MergeTree(event_date, intHash32(id), (id, event_date, intHash32(id)), 8192);
|
||||
CREATE TABLE report(id UInt32, event_date Date, priority UInt32, description String) ENGINE = MergeTree(event_date, intHash32(id), (id, event_date, intHash32(id)), 8192);
|
||||
|
||||
INSERT INTO test.report(id,event_date,priority,description) VALUES (1, '2015-01-01', 1, 'foo')(2, '2015-02-01', 2, 'bar')(3, '2015-03-01', 3, 'foo')(4, '2015-04-01', 4, 'bar')(5, '2015-05-01', 5, 'foo');
|
||||
SELECT * FROM (SELECT id, event_date, priority, description FROM remote('127.0.0.{2|3}', test, report)) ORDER BY id ASC;
|
||||
|
||||
DROP TABLE test.report;
|
||||
INSERT INTO report(id,event_date,priority,description) VALUES (1, '2015-01-01', 1, 'foo')(2, '2015-02-01', 2, 'bar')(3, '2015-03-01', 3, 'foo')(4, '2015-04-01', 4, 'bar')(5, '2015-05-01', 5, 'foo');
|
||||
SELECT * FROM (SELECT id, event_date, priority, description FROM remote('127.0.0.{2|3}', currentDatabase(), report)) ORDER BY id ASC;
|
||||
|
||||
DROP TABLE report;
|
||||
|
@ -1,62 +1,62 @@
|
||||
DROP TABLE IF EXISTS test.buffer_00126;
|
||||
DROP TABLE IF EXISTS test.null_sink_00126;
|
||||
DROP TABLE IF EXISTS buffer_00126;
|
||||
DROP TABLE IF EXISTS null_sink_00126;
|
||||
|
||||
CREATE TABLE test.null_sink_00126 (a UInt8, b String, c Array(UInt32)) ENGINE = Null;
|
||||
CREATE TABLE test.buffer_00126 (a UInt8, b String, c Array(UInt32)) ENGINE = Buffer(test, null_sink_00126, 1, 1000, 1000, 1000, 1000, 1000000, 1000000);
|
||||
CREATE TABLE null_sink_00126 (a UInt8, b String, c Array(UInt32)) ENGINE = Null;
|
||||
CREATE TABLE buffer_00126 (a UInt8, b String, c Array(UInt32)) ENGINE = Buffer(currentDatabase(), null_sink_00126, 1, 1000, 1000, 1000, 1000, 1000000, 1000000);
|
||||
|
||||
INSERT INTO test.buffer_00126 VALUES (1, '2', [3]);
|
||||
INSERT INTO buffer_00126 VALUES (1, '2', [3]);
|
||||
|
||||
SELECT a, b, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c FROM buffer_00126 ORDER BY a, b, c;
|
||||
|
||||
INSERT INTO test.buffer_00126 (c, b, a) VALUES ([7], '8', 9);
|
||||
INSERT INTO buffer_00126 (c, b, a) VALUES ([7], '8', 9);
|
||||
|
||||
SELECT a, b, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c FROM buffer_00126 ORDER BY a, b, c;
|
||||
|
||||
INSERT INTO test.buffer_00126 (a, c) VALUES (11, [33]);
|
||||
INSERT INTO buffer_00126 (a, c) VALUES (11, [33]);
|
||||
|
||||
SELECT a, b, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c FROM test.buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a, c FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b, a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c, b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT a FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT b FROM buffer_00126 ORDER BY a, b, c;
|
||||
SELECT c FROM buffer_00126 ORDER BY a, b, c;
|
||||
|
||||
DROP TABLE test.buffer_00126;
|
||||
DROP TABLE test.null_sink_00126;
|
||||
DROP TABLE buffer_00126;
|
||||
DROP TABLE null_sink_00126;
|
||||
|
@ -1,23 +1,23 @@
|
||||
DROP TABLE IF EXISTS test.mt_00160;
|
||||
DROP TABLE IF EXISTS test.merge_00160;
|
||||
DROP TABLE IF EXISTS mt_00160;
|
||||
DROP TABLE IF EXISTS merge_00160;
|
||||
|
||||
CREATE TABLE test.mt_00160 (d Date DEFAULT toDate('2015-05-01'), x UInt64) ENGINE = MergeTree(d, x, 1);
|
||||
CREATE TABLE test.merge_00160 (d Date, x UInt64) ENGINE = Merge(test, '^mt_00160$');
|
||||
CREATE TABLE mt_00160 (d Date DEFAULT toDate('2015-05-01'), x UInt64) ENGINE = MergeTree(d, x, 1);
|
||||
CREATE TABLE merge_00160 (d Date, x UInt64) ENGINE = Merge(currentDatabase(), '^mt_00160$');
|
||||
|
||||
SET min_insert_block_size_rows = 0, min_insert_block_size_bytes = 0;
|
||||
SET max_block_size = 1000000;
|
||||
INSERT INTO test.mt_00160 (x) SELECT number AS x FROM system.numbers LIMIT 100000;
|
||||
INSERT INTO mt_00160 (x) SELECT number AS x FROM system.numbers LIMIT 100000;
|
||||
|
||||
SELECT *, b FROM test.mt_00160 WHERE x IN (12345, 67890) AND NOT ignore(blockSize() < 10 AS b) ORDER BY x;
|
||||
SELECT *, b FROM test.merge_00160 WHERE x IN (12345, 67890) AND NOT ignore(blockSize() < 10 AS b) ORDER BY x;
|
||||
SELECT *, b FROM mt_00160 WHERE x IN (12345, 67890) AND NOT ignore(blockSize() < 10 AS b) ORDER BY x;
|
||||
SELECT *, b FROM merge_00160 WHERE x IN (12345, 67890) AND NOT ignore(blockSize() < 10 AS b) ORDER BY x;
|
||||
|
||||
DROP TABLE test.merge_00160;
|
||||
DROP TABLE test.mt_00160;
|
||||
DROP TABLE merge_00160;
|
||||
DROP TABLE mt_00160;
|
||||
|
||||
CREATE TABLE test.mt_00160 (d Date DEFAULT toDate('2015-05-01'), x UInt64, y UInt64, z UInt64) ENGINE = MergeTree(d, (x, z), 1);
|
||||
CREATE TABLE mt_00160 (d Date DEFAULT toDate('2015-05-01'), x UInt64, y UInt64, z UInt64) ENGINE = MergeTree(d, (x, z), 1);
|
||||
|
||||
INSERT INTO test.mt_00160 (x, y, z) SELECT number AS x, number + 10 AS y, number / 2 AS z FROM system.numbers LIMIT 100000;
|
||||
INSERT INTO mt_00160 (x, y, z) SELECT number AS x, number + 10 AS y, number / 2 AS z FROM system.numbers LIMIT 100000;
|
||||
|
||||
SELECT *, b FROM test.mt_00160 WHERE (z, y, x) IN ((617, 1244, 1234), (2839, 5688, 5678), (1,1,1)) AND NOT ignore(blockSize() < 10 AS b) ORDER BY (x, y, z);
|
||||
SELECT *, b FROM mt_00160 WHERE (z, y, x) IN ((617, 1244, 1234), (2839, 5688, 5678), (1,1,1)) AND NOT ignore(blockSize() < 10 AS b) ORDER BY (x, y, z);
|
||||
|
||||
DROP TABLE test.mt_00160;
|
||||
DROP TABLE mt_00160;
|
||||
|
@ -1,12 +1,12 @@
|
||||
DROP TABLE IF EXISTS test.mt_00168;
|
||||
DROP TABLE IF EXISTS test.mt_00168_buffer;
|
||||
CREATE TABLE test.mt_00168 (EventDate Date, UTCEventTime DateTime, MoscowEventDate Date DEFAULT toDate(UTCEventTime)) ENGINE = MergeTree(EventDate, UTCEventTime, 8192);
|
||||
CREATE TABLE test.mt_00168_buffer AS test.mt_00168 ENGINE = Buffer(test, mt_00168, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
|
||||
DESC TABLE test.mt_00168;
|
||||
DESC TABLE test.mt_00168_buffer;
|
||||
INSERT INTO test.mt_00168 (EventDate, UTCEventTime) VALUES ('2015-06-09', '2015-06-09 01:02:03');
|
||||
SELECT * FROM test.mt_00168_buffer;
|
||||
INSERT INTO test.mt_00168_buffer (EventDate, UTCEventTime) VALUES ('2015-06-09', '2015-06-09 01:02:03');
|
||||
SELECT * FROM test.mt_00168_buffer;
|
||||
DROP TABLE test.mt_00168_buffer;
|
||||
DROP TABLE test.mt_00168;
|
||||
DROP TABLE IF EXISTS mt_00168;
|
||||
DROP TABLE IF EXISTS mt_00168_buffer;
|
||||
CREATE TABLE mt_00168 (EventDate Date, UTCEventTime DateTime, MoscowEventDate Date DEFAULT toDate(UTCEventTime)) ENGINE = MergeTree(EventDate, UTCEventTime, 8192);
|
||||
CREATE TABLE mt_00168_buffer AS mt_00168 ENGINE = Buffer(currentDatabase(), mt_00168, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
|
||||
DESC TABLE mt_00168;
|
||||
DESC TABLE mt_00168_buffer;
|
||||
INSERT INTO mt_00168 (EventDate, UTCEventTime) VALUES ('2015-06-09', '2015-06-09 01:02:03');
|
||||
SELECT * FROM mt_00168_buffer;
|
||||
INSERT INTO mt_00168_buffer (EventDate, UTCEventTime) VALUES ('2015-06-09', '2015-06-09 01:02:03');
|
||||
SELECT * FROM mt_00168_buffer;
|
||||
DROP TABLE mt_00168_buffer;
|
||||
DROP TABLE mt_00168;
|
||||
|
@ -1,5 +1,5 @@
|
||||
DROP TABLE IF EXISTS test.numbers_memory;
|
||||
CREATE TABLE test.numbers_memory AS system.numbers ENGINE = Memory;
|
||||
INSERT INTO test.numbers_memory SELECT number FROM system.numbers LIMIT 100;
|
||||
SELECT DISTINCT number FROM remote('127.0.0.{2,3}', test.numbers_memory) ORDER BY number LIMIT 10;
|
||||
DROP TABLE test.numbers_memory;
|
||||
DROP TABLE IF EXISTS numbers_memory;
|
||||
CREATE TABLE numbers_memory AS system.numbers ENGINE = Memory;
|
||||
INSERT INTO numbers_memory SELECT number FROM system.numbers LIMIT 100;
|
||||
SELECT DISTINCT number FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_memory) ORDER BY number LIMIT 10;
|
||||
DROP TABLE numbers_memory;
|
||||
|
@ -22,3 +22,6 @@ INSERT INTO t2_00203 VALUES ('ccc', 4, 3, 2), ('ddd', 7, 6, 5);
|
||||
SELECT k1, k2, k3, val_t1, val_t2 FROM t1_00203 ANY FULL JOIN t2_00203 USING (k3, k1, k2 AS k2_alias) ORDER BY k1, k2, k3;
|
||||
|
||||
SELECT k1, k2, k3, val_t1, val_t2 FROM t1_00203 ANY RIGHT JOIN t2_00203 USING (k3, k1, k2 AS k2_alias) ORDER BY k1, k2, k3;
|
||||
|
||||
DROP TABLE t1_00203;
|
||||
DROP TABLE t2_00203;
|
||||
|
@ -1,131 +1,131 @@
|
||||
SET max_block_size = 1000;
|
||||
|
||||
DROP TABLE IF EXISTS test.numbers_10_00223;
|
||||
CREATE TABLE test.numbers_10_00223 ENGINE = Log AS SELECT * FROM system.numbers LIMIT 10000;
|
||||
DROP TABLE IF EXISTS numbers_10_00223;
|
||||
CREATE TABLE numbers_10_00223 ENGINE = Log AS SELECT * FROM system.numbers LIMIT 10000;
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 0;
|
||||
SET group_by_two_level_threshold = 1000;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 0;
|
||||
SET group_by_two_level_threshold = 7;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1;
|
||||
SET group_by_two_level_threshold = 1000;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1;
|
||||
SET group_by_two_level_threshold = 7;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1;
|
||||
SET group_by_two_level_threshold = 1;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10) FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1;
|
||||
SET group_by_two_level_threshold = 1000;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1;
|
||||
SET group_by_two_level_threshold = 1;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
SELECT sum(c = 1) IN (0, 10), sum(c = 2) IN (0, 5), sum(c) = 10 FROM (SELECT number, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) AND number >= (randConstant() % 2 ? 0 : 5) GROUP BY number);
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1;
|
||||
SET group_by_two_level_threshold = 7;
|
||||
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 1) IN (0, 5), sum(c = 2) IN (5, 10), sum(c) IN (10, 15, 20) FROM (SELECT number AS k1, number + 1 AS k2, count() AS c FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 5 : 10) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', test.numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
SELECT sum(c = 20) IN (5, 10), sum(c = 10) IN (0, 5), sum(u != 10) = 0 FROM (SELECT intDiv(number, 10) AS k1, k1 + 1 AS k2, count() AS c, uniq(number) AS u FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00223) WHERE number < (randConstant() % 2 ? 50 : 100) GROUP BY k1, k2 HAVING count() > 0 ORDER BY k1, k2);
|
||||
|
||||
DROP TABLE test.numbers_10_00223;
|
||||
DROP TABLE numbers_10_00223;
|
||||
|
||||
SELECT count() FROM remote('127.0.0.{2,3}', system.one);
|
||||
|
@ -1,7 +1,7 @@
|
||||
DROP TABLE IF EXISTS test.numbers_100k_log;
|
||||
CREATE TABLE test.numbers_100k_log ENGINE = Log AS SELECT * FROM system.numbers LIMIT 100000;
|
||||
DROP TABLE IF EXISTS numbers_100k_log;
|
||||
CREATE TABLE numbers_100k_log ENGINE = Log AS SELECT * FROM system.numbers LIMIT 100000;
|
||||
|
||||
SELECT count() = 200000 FROM remote('127.0.0.{2,3}', test.numbers_100k_log) GROUP BY number WITH TOTALS ORDER BY number LIMIT 10;
|
||||
SELECT count() = 200000 FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_100k_log) GROUP BY number WITH TOTALS ORDER BY number LIMIT 10;
|
||||
|
||||
SET distributed_aggregation_memory_efficient = 1,
|
||||
group_by_two_level_threshold = 1000,
|
||||
@ -9,6 +9,6 @@ SET distributed_aggregation_memory_efficient = 1,
|
||||
max_rows_to_group_by = 1000,
|
||||
totals_mode = 'after_having_auto';
|
||||
|
||||
SELECT count() = 200000 FROM remote('127.0.0.{2,3}', test.numbers_100k_log) GROUP BY number WITH TOTALS ORDER BY number LIMIT 10;
|
||||
SELECT count() = 200000 FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_100k_log) GROUP BY number WITH TOTALS ORDER BY number LIMIT 10;
|
||||
|
||||
DROP TABLE test.numbers_100k_log;
|
||||
DROP TABLE numbers_100k_log;
|
||||
|
@ -1,6 +1,8 @@
|
||||
DROP TABLE IF EXISTS test.storage;
|
||||
CREATE TABLE test.storage(UserID UInt64) ENGINE=Memory;
|
||||
INSERT INTO test.storage(UserID) values (6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(402895971392036118)(402895971392036118)(402895971392036118);
|
||||
DROP TABLE IF EXISTS storage;
|
||||
CREATE TABLE storage(UserID UInt64) ENGINE=Memory;
|
||||
INSERT INTO storage(UserID) values (6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(6460432721393873721)(402895971392036118)(402895971392036118)(402895971392036118);
|
||||
|
||||
SELECT sum(UserID GLOBAL IN (SELECT UserID FROM remote('127.0.0.{2,3}', test.storage))) FROM remote('127.0.0.{2,3}', test.storage);
|
||||
SELECT sum(UserID GLOBAL IN (SELECT UserID FROM test.storage)) FROM remote('127.0.0.{2,3}', test.storage);
|
||||
SELECT sum(UserID GLOBAL IN (SELECT UserID FROM remote('127.0.0.{2,3}', currentDatabase(), storage))) FROM remote('127.0.0.{2,3}', currentDatabase(), storage);
|
||||
SELECT sum(UserID GLOBAL IN (SELECT UserID FROM storage)) FROM remote('127.0.0.{2,3}', currentDatabase(), storage);
|
||||
|
||||
DROP TABLE storage;
|
||||
|
@ -6,18 +6,18 @@ SELECT quantileTimingWeighted(0.5)(number, 1) FROM (SELECT number FROM system.nu
|
||||
SELECT quantilesTimingWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, 1) FROM (SELECT number FROM system.numbers LIMIT 1001);
|
||||
SELECT quantilesTimingWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, number) FROM (SELECT number FROM system.numbers LIMIT 1001);
|
||||
|
||||
DROP TABLE IF EXISTS test.numbers_1001;
|
||||
CREATE TABLE test.numbers_1001 (number UInt64) ENGINE = Memory;
|
||||
DROP TABLE IF EXISTS numbers_1001;
|
||||
CREATE TABLE numbers_1001 (number UInt64) ENGINE = Memory;
|
||||
SET min_insert_block_size_rows = 0, min_insert_block_size_bytes = 0;
|
||||
SET max_block_size = 10;
|
||||
INSERT INTO test.numbers_1001 SELECT number FROM system.numbers LIMIT 1001;
|
||||
INSERT INTO numbers_1001 SELECT number FROM system.numbers LIMIT 1001;
|
||||
|
||||
SELECT quantileExactWeighted(0.5)(number, 1) FROM remote('127.0.0.{2,3}', test.numbers_1001);
|
||||
SELECT quantilesExactWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, 1) FROM remote('127.0.0.{2,3}', test.numbers_1001);
|
||||
SELECT quantilesExactWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, number) FROM remote('127.0.0.{2,3}', test.numbers_1001);
|
||||
SELECT quantileExactWeighted(0.5)(number, 1) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_1001);
|
||||
SELECT quantilesExactWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, 1) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_1001);
|
||||
SELECT quantilesExactWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, number) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_1001);
|
||||
|
||||
SELECT quantileTimingWeighted(0.5)(number, 1) FROM remote('127.0.0.{2,3}', test.numbers_1001);
|
||||
SELECT quantilesTimingWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, 1) FROM remote('127.0.0.{2,3}', test.numbers_1001);
|
||||
SELECT quantilesTimingWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, number) FROM remote('127.0.0.{2,3}', test.numbers_1001);
|
||||
SELECT quantileTimingWeighted(0.5)(number, 1) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_1001);
|
||||
SELECT quantilesTimingWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, 1) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_1001);
|
||||
SELECT quantilesTimingWeighted(0, 0.001, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 0.999, 1)(number, number) FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_1001);
|
||||
|
||||
DROP TABLE test.numbers_1001;
|
||||
DROP TABLE numbers_1001;
|
||||
|
@ -1,17 +1,17 @@
|
||||
DROP TABLE IF EXISTS test.numbers_10_00290;
|
||||
DROP TABLE IF EXISTS numbers_10_00290;
|
||||
SET max_block_size = 1000;
|
||||
CREATE TABLE test.numbers_10_00290 ENGINE = Log AS SELECT * FROM system.numbers LIMIT 10000;
|
||||
CREATE TABLE numbers_10_00290 ENGINE = Log AS SELECT * FROM system.numbers LIMIT 10000;
|
||||
SET distributed_aggregation_memory_efficient = 1, group_by_two_level_threshold = 5000;
|
||||
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', test.numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
SELECT concat(toString(number), arrayStringConcat(arrayMap(x -> '.', range(number % 10)))) AS k FROM remote('127.0.0.{2,3}', currentDatabase(), numbers_10_00290) WHERE number < (randConstant() % 2 ? 4999 : 10000) GROUP BY k ORDER BY k LIMIT 10;
|
||||
|
||||
DROP TABLE test.numbers_10_00290;
|
||||
DROP TABLE numbers_10_00290;
|
||||
|
@ -1,80 +1,80 @@
|
||||
set max_threads = 1;
|
||||
drop table if exists test.enums;
|
||||
drop table if exists enums;
|
||||
|
||||
create table test.enums (
|
||||
create table enums (
|
||||
d Date default '2015-12-29', k default 0,
|
||||
e Enum8('world' = 2, 'hello' = 1), sign Enum8('minus' = -1, 'plus' = 1),
|
||||
letter Enum16('a' = 0, 'b' = 1, 'c' = 2, '*' = -256)
|
||||
) engine = MergeTree(d, k, 1);
|
||||
|
||||
desc table test.enums;
|
||||
desc table enums;
|
||||
|
||||
-- insert default values
|
||||
insert into test.enums (k) values (0);
|
||||
select * from test.enums;
|
||||
insert into enums (k) values (0);
|
||||
select * from enums;
|
||||
|
||||
alter table test.enums modify column e Enum8('world' = 2, 'hello' = 1, '!' = 3);
|
||||
desc table test.enums;
|
||||
alter table enums modify column e Enum8('world' = 2, 'hello' = 1, '!' = 3);
|
||||
desc table enums;
|
||||
|
||||
insert into test.enums (e, sign, letter) values ('!', 'plus', 'b');
|
||||
select * from test.enums ORDER BY _part;
|
||||
insert into enums (e, sign, letter) values ('!', 'plus', 'b');
|
||||
select * from enums ORDER BY _part;
|
||||
|
||||
-- expand `e` and `sign` from Enum8 to Enum16 without changing values, change values of `letter` without changing type
|
||||
alter table test.enums
|
||||
alter table enums
|
||||
modify column e Enum16('world' = 2, 'hello' = 1, '!' = 3),
|
||||
modify column sign Enum16('minus' = -1, 'plus' = 1),
|
||||
modify column letter Enum16('a' = 0, 'b' = 1, 'c' = 2, 'no letter' = -256);
|
||||
desc table test.enums;
|
||||
desc table enums;
|
||||
|
||||
select * from test.enums ORDER BY _part;
|
||||
select * from enums ORDER BY _part;
|
||||
|
||||
alter table test.enums
|
||||
alter table enums
|
||||
modify column e Enum8('world' = 2, 'hello' = 1, '!' = 3),
|
||||
modify column sign Enum8('minus' = -1, 'plus' = 1);
|
||||
|
||||
desc table test.enums;
|
||||
desc table enums;
|
||||
|
||||
insert into test.enums (letter, e) values ('c', 'world');
|
||||
select * from test.enums ORDER BY _part;
|
||||
insert into enums (letter, e) values ('c', 'world');
|
||||
select * from enums ORDER BY _part;
|
||||
|
||||
drop table test.enums;
|
||||
drop table enums;
|
||||
|
||||
create table test.enums (e Enum8('a' = 0, 'b' = 1, 'c' = 2, 'd' = 3)) engine = TinyLog;
|
||||
insert into test.enums values ('d'), ('b'), ('a'), ('c'), ('a'), ('d');
|
||||
select * from test.enums;
|
||||
create table enums (e Enum8('a' = 0, 'b' = 1, 'c' = 2, 'd' = 3)) engine = TinyLog;
|
||||
insert into enums values ('d'), ('b'), ('a'), ('c'), ('a'), ('d');
|
||||
select * from enums;
|
||||
|
||||
-- ORDER BY
|
||||
select * from test.enums order by e;
|
||||
select * from test.enums order by e desc;
|
||||
select * from enums order by e;
|
||||
select * from enums order by e desc;
|
||||
|
||||
-- GROUP BY
|
||||
select count(), e from test.enums group by e;
|
||||
select any(e) from test.enums;
|
||||
select count(), e from enums group by e;
|
||||
select any(e) from enums;
|
||||
|
||||
-- IN
|
||||
select * from test.enums where e in ('a', 'd');
|
||||
select * from test.enums where e in (select e from test.enums);
|
||||
select * from enums where e in ('a', 'd');
|
||||
select * from enums where e in (select e from enums);
|
||||
|
||||
-- DISTINCT
|
||||
select distinct e from test.enums;
|
||||
select distinct e from enums;
|
||||
|
||||
-- Comparison
|
||||
select * from test.enums where e = e;
|
||||
select * from test.enums where e = 'a' or e = 'd';
|
||||
select * from test.enums where e != 'a';
|
||||
select *, e < 'b' from test.enums;
|
||||
select *, e > 'b' from test.enums;
|
||||
select * from enums where e = e;
|
||||
select * from enums where e = 'a' or e = 'd';
|
||||
select * from enums where e != 'a';
|
||||
select *, e < 'b' from enums;
|
||||
select *, e > 'b' from enums;
|
||||
|
||||
-- Conversion
|
||||
select toInt8(e), toInt16(e), toUInt64(e), toString(e), e from test.enums;
|
||||
select toInt8(e), toInt16(e), toUInt64(e), toString(e), e from enums;
|
||||
|
||||
drop table if exists test.enums_copy;
|
||||
create table test.enums_copy engine = TinyLog as select * from test.enums;
|
||||
select * from test.enums_copy;
|
||||
drop table if exists enums_copy;
|
||||
create table enums_copy engine = TinyLog as select * from enums;
|
||||
select * from enums_copy;
|
||||
|
||||
drop table test.enums_copy;
|
||||
create table test.enums_copy engine = TinyLog as select * from remote('127.0.0.2', test, enums);
|
||||
select * from remote('127.0.0.2', test, enums_copy);
|
||||
drop table enums_copy;
|
||||
create table enums_copy engine = TinyLog as select * from remote('127.0.0.2', currentDatabase(), enums);
|
||||
select * from remote('127.0.0.2', currentDatabase(), enums_copy);
|
||||
|
||||
drop table test.enums_copy;
|
||||
drop table test.enums;
|
||||
drop table enums_copy;
|
||||
drop table enums;
|
||||
|
@ -1,20 +1,20 @@
|
||||
DROP TABLE IF EXISTS test.sample_00314_1;
|
||||
DROP TABLE IF EXISTS test.sample_00314_2;
|
||||
DROP TABLE IF EXISTS test.sample_merge_00314;
|
||||
DROP TABLE IF EXISTS sample_00314_1;
|
||||
DROP TABLE IF EXISTS sample_00314_2;
|
||||
DROP TABLE IF EXISTS sample_merge_00314;
|
||||
|
||||
CREATE TABLE test.sample_00314_1 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
CREATE TABLE test.sample_00314_2 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
CREATE TABLE sample_00314_1 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
CREATE TABLE sample_00314_2 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
|
||||
SET min_insert_block_size_rows = 0, min_insert_block_size_bytes = 0;
|
||||
|
||||
INSERT INTO test.sample_00314_1 (x) SELECT number AS x FROM system.numbers LIMIT 1000000;
|
||||
INSERT INTO test.sample_00314_2 (x) SELECT number AS x FROM system.numbers LIMIT 2000000;
|
||||
INSERT INTO sample_00314_1 (x) SELECT number AS x FROM system.numbers LIMIT 1000000;
|
||||
INSERT INTO sample_00314_2 (x) SELECT number AS x FROM system.numbers LIMIT 2000000;
|
||||
|
||||
CREATE TABLE test.sample_merge_00314 AS test.sample_00314_1 ENGINE = Merge(test, '^sample_00314_\\d$');
|
||||
CREATE TABLE sample_merge_00314 AS sample_00314_1 ENGINE = Merge(currentDatabase(), '^sample_00314_\\d$');
|
||||
|
||||
SELECT abs(sum(_sample_factor) - 3000000) / 3000000 < 0.001 FROM test.sample_merge_00314 SAMPLE 100000;
|
||||
SELECT abs(sum(_sample_factor) - 3000000) / 3000000 < 0.001 FROM merge(test, '^sample_00314_\\d$') SAMPLE 100000;
|
||||
SELECT abs(sum(_sample_factor) - 3000000) / 3000000 < 0.001 FROM sample_merge_00314 SAMPLE 100000;
|
||||
SELECT abs(sum(_sample_factor) - 3000000) / 3000000 < 0.001 FROM merge(currentDatabase(), '^sample_00314_\\d$') SAMPLE 100000;
|
||||
|
||||
DROP TABLE test.sample_00314_1;
|
||||
DROP TABLE test.sample_00314_2;
|
||||
DROP TABLE test.sample_merge_00314;
|
||||
DROP TABLE sample_00314_1;
|
||||
DROP TABLE sample_00314_2;
|
||||
DROP TABLE sample_merge_00314;
|
||||
|
@ -1,12 +1,12 @@
|
||||
DROP TABLE IF EXISTS test.group_uniq_arr_int;
|
||||
CREATE TABLE test.group_uniq_arr_int ENGINE = Memory AS
|
||||
SELECT g as id, if(c == 0, [v], if(c == 1, emptyArrayInt64(), [v, v])) as v FROM
|
||||
DROP TABLE IF EXISTS group_uniq_arr_int;
|
||||
CREATE TABLE group_uniq_arr_int ENGINE = Memory AS
|
||||
SELECT g as id, if(c == 0, [v], if(c == 1, emptyArrayInt64(), [v, v])) as v FROM
|
||||
(SELECT intDiv(number%1000000, 100) as v, intDiv(number%100, 10) as g, number%10 as c FROM system.numbers WHERE c < 3 LIMIT 10000000);
|
||||
|
||||
SELECT length(groupUniqArray(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', 'test', 'group_uniq_arr_int') GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(10)(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(100000)(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(v)) FROM group_uniq_arr_int GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', currentDatabase(), 'group_uniq_arr_int') GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(10)(v)) FROM group_uniq_arr_int GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(100000)(v)) FROM group_uniq_arr_int GROUP BY id ORDER BY id;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS test.group_uniq_arr_int;
|
||||
DROP TABLE IF EXISTS group_uniq_arr_int;
|
||||
|
@ -1,9 +1,9 @@
|
||||
DROP TABLE IF EXISTS test.group_uniq_arr_str;
|
||||
CREATE TABLE test.group_uniq_arr_str ENGINE = Memory AS
|
||||
SELECT hex(intHash32(g)) as id, if(c == 0, [hex(v)], if(c == 1, emptyArrayString(), [hex(v), hex(v)])) as v FROM
|
||||
DROP TABLE IF EXISTS group_uniq_arr_str;
|
||||
CREATE TABLE group_uniq_arr_str ENGINE = Memory AS
|
||||
SELECT hex(intHash32(g)) as id, if(c == 0, [hex(v)], if(c == 1, emptyArrayString(), [hex(v), hex(v)])) as v FROM
|
||||
(SELECT intDiv(number%1000000, 100) as v, intDiv(number%100, 10) as g, number%10 as c FROM system.numbers WHERE c < 3 LIMIT 10000000);
|
||||
|
||||
SELECT length(groupUniqArray(v)) FROM test.group_uniq_arr_str GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', 'test', 'group_uniq_arr_str') GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(v)) FROM group_uniq_arr_str GROUP BY id ORDER BY id;
|
||||
SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', currentDatabase(), 'group_uniq_arr_str') GROUP BY id ORDER BY id;
|
||||
|
||||
DROP TABLE IF EXISTS test.group_uniq_arr_str;
|
||||
DROP TABLE IF EXISTS group_uniq_arr_str;
|
||||
|
@ -40,3 +40,5 @@ SELECT cityHash64(groupArray(d)) FROM enum_pk WHERE d IN ('0', '1');
|
||||
|
||||
SELECT cityHash64(groupArray(x)) FROM enum_pk WHERE (x != '0' AND x != '1');
|
||||
SELECT cityHash64(groupArray(d)) FROM enum_pk WHERE (d != '0' AND d != '1');
|
||||
|
||||
DROP TABLE enum_pk;
|
||||
|
@ -1,23 +1,22 @@
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.has_column_in_table;
|
||||
CREATE TABLE test.has_column_in_table (i Int64, s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory;
|
||||
DROP TABLE IF EXISTS has_column_in_table;
|
||||
CREATE TABLE has_column_in_table (i Int64, s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory;
|
||||
|
||||
/* existing column */
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 'i');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 'i');
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 's');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 's');
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 'nest.x');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 'nest.x');
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 'nest.y');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 'nest.y');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'i');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'i');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 's');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 's');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest.x');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest.x');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest.y');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest.y');
|
||||
|
||||
/* not existing column */
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 'nest');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 'nest');
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 'nest.not_existing');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 'nest.not_existing');
|
||||
SELECT hasColumnInTable('test', 'has_column_in_table', 'not_existing');
|
||||
SELECT hasColumnInTable('localhost', 'test', 'has_column_in_table', 'not_existing');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest.not_existing');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest.not_existing');
|
||||
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'not_existing');
|
||||
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'not_existing');
|
||||
|
||||
DROP TABLE test.has_column_in_table;
|
||||
DROP TABLE has_column_in_table;
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
SELECT '----- NULL value -----';
|
||||
|
||||
SELECT NULL;
|
||||
@ -148,18 +147,18 @@ SELECT col1 FROM test1_00395 WHERE col1 IS NULL;
|
||||
|
||||
SELECT '----- if -----';
|
||||
|
||||
DROP TABLE IF EXISTS test.test1_00395;
|
||||
CREATE TABLE test.test1_00395 (col1 Nullable(String)) ENGINE=TinyLog;
|
||||
INSERT INTO test.test1_00395 VALUES ('a'), ('b'), ('c'), (NULL);
|
||||
DROP TABLE IF EXISTS test1_00395;
|
||||
CREATE TABLE test1_00395 (col1 Nullable(String)) ENGINE=TinyLog;
|
||||
INSERT INTO test1_00395 VALUES ('a'), ('b'), ('c'), (NULL);
|
||||
|
||||
SELECT col1, if(col1 IN ('a' ,'b'), 1, 0) AS t, toTypeName(t) FROM test.test1_00395;
|
||||
SELECT col1, if(col1 IN ('a' ,'b'), NULL, 0) AS t, toTypeName(t) FROM test.test1_00395;
|
||||
SELECT col1, if(col1 IN ('a' ,'b'), 1, 0) AS t, toTypeName(t) FROM test1_00395;
|
||||
SELECT col1, if(col1 IN ('a' ,'b'), NULL, 0) AS t, toTypeName(t) FROM test1_00395;
|
||||
|
||||
SELECT '----- case when -----';
|
||||
|
||||
SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN 1 ELSE 0 END AS t, toTypeName(t) FROM test.test1_00395;
|
||||
SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN NULL ELSE 0 END AS t, toTypeName(t) FROM test.test1_00395;
|
||||
SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN 1 END AS t, toTypeName(t) FROM test.test1_00395;
|
||||
SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN 1 ELSE 0 END AS t, toTypeName(t) FROM test1_00395;
|
||||
SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN NULL ELSE 0 END AS t, toTypeName(t) FROM test1_00395;
|
||||
SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN 1 END AS t, toTypeName(t) FROM test1_00395;
|
||||
|
||||
SELECT '----- multiIf -----';
|
||||
|
||||
@ -497,3 +496,4 @@ INSERT INTO test1_00395(col1,col2) VALUES([NULL], 'ACDEFBGH');
|
||||
SELECT col1, count() FROM test1_00395 GROUP BY col1 ORDER BY col1;
|
||||
|
||||
DROP TABLE IF EXISTS test1_00395;
|
||||
DROP TABLE test2;
|
||||
|
@ -5,3 +5,4 @@ SET preferred_max_column_in_block_size_bytes = 32;
|
||||
SELECT blockSize(), * from tab_00481 format Null;
|
||||
SELECT 0;
|
||||
|
||||
DROP TABLE tab_00481;
|
||||
|
@ -32,3 +32,4 @@ insert into tab_00484 select today(), number, 'abc' from system.numbers limit 81
|
||||
set preferred_block_size_bytes = 0;
|
||||
select count(*) from tab_00484 prewhere s != 'abc' format Null;
|
||||
select count(*) from tab_00484 prewhere s = 'abc' format Null;
|
||||
drop table tab_00484;
|
||||
|
@ -1,8 +1,8 @@
|
||||
DROP TABLE IF EXISTS test.nested;
|
||||
CREATE TABLE test.nested (n Nested(x UInt8)) ENGINE = Memory;
|
||||
INSERT INTO test.nested VALUES ([1, 2]);
|
||||
SELECT 1 AS x FROM remote('127.0.0.2', test.nested) ARRAY JOIN n.x;
|
||||
DROP TABLE test.nested;
|
||||
DROP TABLE IF EXISTS nested;
|
||||
CREATE TABLE nested (n Nested(x UInt8)) ENGINE = Memory;
|
||||
INSERT INTO nested VALUES ([1, 2]);
|
||||
SELECT 1 AS x FROM remote('127.0.0.2', currentDatabase(), nested) ARRAY JOIN n.x;
|
||||
DROP TABLE nested;
|
||||
|
||||
SELECT dummy AS dummy, dummy AS b FROM system.one;
|
||||
SELECT dummy AS dummy, dummy AS b, b AS c FROM system.one;
|
||||
|
@ -9,7 +9,7 @@ Sum before DETACH PARTITION:
|
||||
Sum after DETACH PARTITION:
|
||||
0
|
||||
system.detached_parts after DETACH PARTITION:
|
||||
test not_partitioned all all_1_2_1 1 2 1
|
||||
default not_partitioned all all_1_2_1 1 2 1
|
||||
*** Partitioned by week ***
|
||||
Parts before OPTIMIZE:
|
||||
1999-12-27 19991227_1_1_0
|
||||
|
@ -1,109 +1,109 @@
|
||||
SELECT '*** Not partitioned ***';
|
||||
|
||||
DROP TABLE IF EXISTS test.not_partitioned;
|
||||
CREATE TABLE test.not_partitioned(x UInt8) ENGINE MergeTree ORDER BY x;
|
||||
DROP TABLE IF EXISTS not_partitioned;
|
||||
CREATE TABLE not_partitioned(x UInt8) ENGINE MergeTree ORDER BY x;
|
||||
|
||||
INSERT INTO test.not_partitioned VALUES (1), (2), (3);
|
||||
INSERT INTO test.not_partitioned VALUES (4), (5);
|
||||
INSERT INTO not_partitioned VALUES (1), (2), (3);
|
||||
INSERT INTO not_partitioned VALUES (4), (5);
|
||||
|
||||
SELECT 'Parts before OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'not_partitioned' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE test.not_partitioned PARTITION tuple() FINAL;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'not_partitioned' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE not_partitioned PARTITION tuple() FINAL;
|
||||
SELECT 'Parts after OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'not_partitioned' AND active ORDER BY name;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'not_partitioned' AND active ORDER BY name;
|
||||
|
||||
SELECT 'Sum before DETACH PARTITION:';
|
||||
SELECT sum(x) FROM test.not_partitioned;
|
||||
ALTER TABLE test.not_partitioned DETACH PARTITION ID 'all';
|
||||
SELECT sum(x) FROM not_partitioned;
|
||||
ALTER TABLE not_partitioned DETACH PARTITION ID 'all';
|
||||
SELECT 'Sum after DETACH PARTITION:';
|
||||
SELECT sum(x) FROM test.not_partitioned;
|
||||
SELECT sum(x) FROM not_partitioned;
|
||||
SELECT 'system.detached_parts after DETACH PARTITION:';
|
||||
SELECT * FROM system.detached_parts WHERE table = 'not_partitioned';
|
||||
|
||||
DROP TABLE test.not_partitioned;
|
||||
DROP TABLE not_partitioned;
|
||||
|
||||
SELECT '*** Partitioned by week ***';
|
||||
|
||||
DROP TABLE IF EXISTS test.partitioned_by_week;
|
||||
CREATE TABLE test.partitioned_by_week(d Date, x UInt8) ENGINE = MergeTree PARTITION BY toMonday(d) ORDER BY x;
|
||||
DROP TABLE IF EXISTS partitioned_by_week;
|
||||
CREATE TABLE partitioned_by_week(d Date, x UInt8) ENGINE = MergeTree PARTITION BY toMonday(d) ORDER BY x;
|
||||
|
||||
-- 2000-01-03 belongs to a different week than 2000-01-01 and 2000-01-02
|
||||
INSERT INTO test.partitioned_by_week VALUES ('2000-01-01', 1), ('2000-01-02', 2), ('2000-01-03', 3);
|
||||
INSERT INTO test.partitioned_by_week VALUES ('2000-01-03', 4), ('2000-01-03', 5);
|
||||
INSERT INTO partitioned_by_week VALUES ('2000-01-01', 1), ('2000-01-02', 2), ('2000-01-03', 3);
|
||||
INSERT INTO partitioned_by_week VALUES ('2000-01-03', 4), ('2000-01-03', 5);
|
||||
|
||||
SELECT 'Parts before OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'partitioned_by_week' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE test.partitioned_by_week PARTITION '2000-01-03' FINAL;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'partitioned_by_week' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE partitioned_by_week PARTITION '2000-01-03' FINAL;
|
||||
SELECT 'Parts after OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'partitioned_by_week' AND active ORDER BY name;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'partitioned_by_week' AND active ORDER BY name;
|
||||
|
||||
SELECT 'Sum before DROP PARTITION:';
|
||||
SELECT sum(x) FROM test.partitioned_by_week;
|
||||
ALTER TABLE test.partitioned_by_week DROP PARTITION '1999-12-27';
|
||||
SELECT sum(x) FROM partitioned_by_week;
|
||||
ALTER TABLE partitioned_by_week DROP PARTITION '1999-12-27';
|
||||
SELECT 'Sum after DROP PARTITION:';
|
||||
SELECT sum(x) FROM test.partitioned_by_week;
|
||||
SELECT sum(x) FROM partitioned_by_week;
|
||||
|
||||
DROP TABLE test.partitioned_by_week;
|
||||
DROP TABLE partitioned_by_week;
|
||||
|
||||
SELECT '*** Partitioned by a (Date, UInt8) tuple ***';
|
||||
|
||||
DROP TABLE IF EXISTS test.partitioned_by_tuple;
|
||||
CREATE TABLE test.partitioned_by_tuple(d Date, x UInt8, y UInt8) ENGINE MergeTree ORDER BY x PARTITION BY (d, x);
|
||||
DROP TABLE IF EXISTS partitioned_by_tuple;
|
||||
CREATE TABLE partitioned_by_tuple(d Date, x UInt8, y UInt8) ENGINE MergeTree ORDER BY x PARTITION BY (d, x);
|
||||
|
||||
INSERT INTO test.partitioned_by_tuple VALUES ('2000-01-01', 1, 1), ('2000-01-01', 2, 2), ('2000-01-02', 1, 3);
|
||||
INSERT INTO test.partitioned_by_tuple VALUES ('2000-01-02', 1, 4), ('2000-01-01', 1, 5);
|
||||
INSERT INTO partitioned_by_tuple VALUES ('2000-01-01', 1, 1), ('2000-01-01', 2, 2), ('2000-01-02', 1, 3);
|
||||
INSERT INTO partitioned_by_tuple VALUES ('2000-01-02', 1, 4), ('2000-01-01', 1, 5);
|
||||
|
||||
SELECT 'Parts before OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'partitioned_by_tuple' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE test.partitioned_by_tuple PARTITION ('2000-01-01', 1) FINAL;
|
||||
OPTIMIZE TABLE test.partitioned_by_tuple PARTITION ('2000-01-02', 1) FINAL;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'partitioned_by_tuple' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE partitioned_by_tuple PARTITION ('2000-01-01', 1) FINAL;
|
||||
OPTIMIZE TABLE partitioned_by_tuple PARTITION ('2000-01-02', 1) FINAL;
|
||||
SELECT 'Parts after OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'partitioned_by_tuple' AND active ORDER BY name;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'partitioned_by_tuple' AND active ORDER BY name;
|
||||
|
||||
SELECT 'Sum before DETACH PARTITION:';
|
||||
SELECT sum(y) FROM test.partitioned_by_tuple;
|
||||
ALTER TABLE test.partitioned_by_tuple DETACH PARTITION ID '20000101-1';
|
||||
SELECT sum(y) FROM partitioned_by_tuple;
|
||||
ALTER TABLE partitioned_by_tuple DETACH PARTITION ID '20000101-1';
|
||||
SELECT 'Sum after DETACH PARTITION:';
|
||||
SELECT sum(y) FROM test.partitioned_by_tuple;
|
||||
SELECT sum(y) FROM partitioned_by_tuple;
|
||||
|
||||
DROP TABLE test.partitioned_by_tuple;
|
||||
DROP TABLE partitioned_by_tuple;
|
||||
|
||||
SELECT '*** Partitioned by String ***';
|
||||
|
||||
DROP TABLE IF EXISTS test.partitioned_by_string;
|
||||
CREATE TABLE test.partitioned_by_string(s String, x UInt8) ENGINE = MergeTree PARTITION BY s ORDER BY x;
|
||||
DROP TABLE IF EXISTS partitioned_by_string;
|
||||
CREATE TABLE partitioned_by_string(s String, x UInt8) ENGINE = MergeTree PARTITION BY s ORDER BY x;
|
||||
|
||||
INSERT INTO test.partitioned_by_string VALUES ('aaa', 1), ('aaa', 2), ('bbb', 3);
|
||||
INSERT INTO test.partitioned_by_string VALUES ('bbb', 4), ('aaa', 5);
|
||||
INSERT INTO partitioned_by_string VALUES ('aaa', 1), ('aaa', 2), ('bbb', 3);
|
||||
INSERT INTO partitioned_by_string VALUES ('bbb', 4), ('aaa', 5);
|
||||
|
||||
SELECT 'Parts before OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'partitioned_by_string' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE test.partitioned_by_string PARTITION 'aaa' FINAL;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'partitioned_by_string' AND active ORDER BY name;
|
||||
OPTIMIZE TABLE partitioned_by_string PARTITION 'aaa' FINAL;
|
||||
SELECT 'Parts after OPTIMIZE:';
|
||||
SELECT partition, name FROM system.parts WHERE database = 'test' AND table = 'partitioned_by_string' AND active ORDER BY name;
|
||||
SELECT partition, name FROM system.parts WHERE database = currentDatabase() AND table = 'partitioned_by_string' AND active ORDER BY name;
|
||||
|
||||
SELECT 'Sum before DROP PARTITION:';
|
||||
SELECT sum(x) FROM test.partitioned_by_string;
|
||||
ALTER TABLE test.partitioned_by_string DROP PARTITION 'bbb';
|
||||
SELECT sum(x) FROM partitioned_by_string;
|
||||
ALTER TABLE partitioned_by_string DROP PARTITION 'bbb';
|
||||
SELECT 'Sum after DROP PARTITION:';
|
||||
SELECT sum(x) FROM test.partitioned_by_string;
|
||||
SELECT sum(x) FROM partitioned_by_string;
|
||||
|
||||
DROP TABLE test.partitioned_by_string;
|
||||
DROP TABLE partitioned_by_string;
|
||||
|
||||
SELECT '*** Table without columns with fixed size ***';
|
||||
|
||||
DROP TABLE IF EXISTS test.without_fixed_size_columns;
|
||||
CREATE TABLE test.without_fixed_size_columns(s String) ENGINE MergeTree PARTITION BY length(s) ORDER BY s;
|
||||
DROP TABLE IF EXISTS without_fixed_size_columns;
|
||||
CREATE TABLE without_fixed_size_columns(s String) ENGINE MergeTree PARTITION BY length(s) ORDER BY s;
|
||||
|
||||
INSERT INTO test.without_fixed_size_columns VALUES ('a'), ('aa'), ('b'), ('cc');
|
||||
INSERT INTO without_fixed_size_columns VALUES ('a'), ('aa'), ('b'), ('cc');
|
||||
|
||||
SELECT 'Parts:';
|
||||
SELECT partition, name, rows FROM system.parts WHERE database = 'test' AND table = 'without_fixed_size_columns' AND active ORDER BY name;
|
||||
SELECT partition, name, rows FROM system.parts WHERE database = currentDatabase() AND table = 'without_fixed_size_columns' AND active ORDER BY name;
|
||||
|
||||
SELECT 'Before DROP PARTITION:';
|
||||
SELECT * FROM test.without_fixed_size_columns ORDER BY s;
|
||||
ALTER TABLE test.without_fixed_size_columns DROP PARTITION 1;
|
||||
SELECT * FROM without_fixed_size_columns ORDER BY s;
|
||||
ALTER TABLE without_fixed_size_columns DROP PARTITION 1;
|
||||
SELECT 'After DROP PARTITION:';
|
||||
SELECT * FROM test.without_fixed_size_columns ORDER BY s;
|
||||
SELECT * FROM without_fixed_size_columns ORDER BY s;
|
||||
|
||||
DROP TABLE test.without_fixed_size_columns;
|
||||
DROP TABLE without_fixed_size_columns;
|
||||
|
@ -1,58 +1,57 @@
|
||||
|
||||
SELECT X FROM (SELECT * FROM (SELECT 1 AS X, 2 AS Y) UNION ALL SELECT 3, 4) ORDER BY X;
|
||||
|
||||
DROP TABLE IF EXISTS test.globalin;
|
||||
DROP TABLE IF EXISTS globalin;
|
||||
|
||||
CREATE TABLE test.globalin (CounterID UInt32, StartDate Date ) ENGINE = Memory;
|
||||
CREATE TABLE globalin (CounterID UInt32, StartDate Date ) ENGINE = Memory;
|
||||
|
||||
INSERT INTO test.globalin VALUES (34, toDate('2017-10-02')), (42, toDate('2017-10-02')), (55, toDate('2017-10-01'));
|
||||
INSERT INTO globalin VALUES (34, toDate('2017-10-02')), (42, toDate('2017-10-02')), (55, toDate('2017-10-01'));
|
||||
|
||||
SELECT * FROM ( SELECT CounterID FROM remote('127.0.0.2', 'test', 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34))) GROUP BY CounterID);
|
||||
SELECT * FROM ( SELECT CounterID FROM remote('127.0.0.2', currentDatabase(), 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34))) GROUP BY CounterID);
|
||||
SELECT 'NOW okay =========================:';
|
||||
SELECT CounterID FROM remote('127.0.0.2', 'test', 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34) )) GROUP BY CounterID UNION ALL SELECT CounterID FROM remote('127.0.0.2', 'test', 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34))) GROUP BY CounterID;
|
||||
SELECT CounterID FROM remote('127.0.0.2', currentDatabase(), 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34) )) GROUP BY CounterID UNION ALL SELECT CounterID FROM remote('127.0.0.2', currentDatabase(), 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34))) GROUP BY CounterID;
|
||||
SELECT 'NOW BAD ==========================:';
|
||||
SELECT * FROM ( SELECT CounterID FROM remote('127.0.0.2', 'test', 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34) )) GROUP BY CounterID UNION ALL SELECT CounterID FROM remote('127.0.0.2', 'test', 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34))) GROUP BY CounterID);
|
||||
SELECT * FROM ( SELECT CounterID FROM remote('127.0.0.2', currentDatabase(), 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34) )) GROUP BY CounterID UNION ALL SELECT CounterID FROM remote('127.0.0.2', currentDatabase(), 'globalin') WHERE (CounterID GLOBAL IN ( SELECT toUInt32(34))) GROUP BY CounterID);
|
||||
SELECT 'finish ===========================;';
|
||||
|
||||
DROP TABLE test.globalin;
|
||||
DROP TABLE globalin;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS test.union_bug;
|
||||
DROP TABLE IF EXISTS union_bug;
|
||||
|
||||
CREATE TABLE test.union_bug (
|
||||
CREATE TABLE union_bug (
|
||||
Event String,
|
||||
Datetime DateTime('Europe/Moscow')
|
||||
) Engine = Memory;
|
||||
|
||||
INSERT INTO test.union_bug VALUES ('A', 1), ('B', 2);
|
||||
INSERT INTO union_bug VALUES ('A', 1), ('B', 2);
|
||||
|
||||
SELECT ' * A UNION * B:';
|
||||
SELECT * FROM (
|
||||
SELECT * FROM test.union_bug WHERE Event = 'A'
|
||||
SELECT * FROM union_bug WHERE Event = 'A'
|
||||
UNION ALL
|
||||
SELECT * FROM test.union_bug WHERE Event = 'B'
|
||||
SELECT * FROM union_bug WHERE Event = 'B'
|
||||
) ORDER BY Datetime;
|
||||
|
||||
SELECT ' Event, Datetime A UNION * B:';
|
||||
SELECT * FROM (
|
||||
SELECT Event, Datetime FROM test.union_bug WHERE Event = 'A'
|
||||
SELECT Event, Datetime FROM union_bug WHERE Event = 'A'
|
||||
UNION ALL
|
||||
SELECT * FROM test.union_bug WHERE Event = 'B'
|
||||
SELECT * FROM union_bug WHERE Event = 'B'
|
||||
) ORDER BY Datetime;
|
||||
|
||||
SELECT ' * A UNION Event, Datetime B:';
|
||||
SELECT * FROM (
|
||||
SELECT * FROM test.union_bug WHERE Event = 'A'
|
||||
SELECT * FROM union_bug WHERE Event = 'A'
|
||||
UNION ALL
|
||||
SELECT Event, Datetime FROM test.union_bug WHERE Event = 'B'
|
||||
SELECT Event, Datetime FROM union_bug WHERE Event = 'B'
|
||||
) ORDER BY Datetime;
|
||||
|
||||
SELECT ' Event, Datetime A UNION Event, Datetime B:';
|
||||
SELECT * FROM (
|
||||
SELECT Event, Datetime FROM test.union_bug WHERE Event = 'A'
|
||||
SELECT Event, Datetime FROM union_bug WHERE Event = 'A'
|
||||
UNION ALL
|
||||
SELECT Event, Datetime FROM test.union_bug WHERE Event = 'B'
|
||||
SELECT Event, Datetime FROM union_bug WHERE Event = 'B'
|
||||
) ORDER BY Datetime;
|
||||
|
||||
|
||||
DROP TABLE test.union_bug;
|
||||
DROP TABLE union_bug;
|
||||
|
@ -1,24 +1,24 @@
|
||||
|
||||
-- https://github.com/yandex/ClickHouse/issues/1059
|
||||
|
||||
DROP TABLE IF EXISTS test.union1;
|
||||
DROP TABLE IF EXISTS test.union2;
|
||||
DROP TABLE IF EXISTS test.union3;
|
||||
DROP TABLE IF EXISTS union1;
|
||||
DROP TABLE IF EXISTS union2;
|
||||
DROP TABLE IF EXISTS union3;
|
||||
|
||||
CREATE TABLE test.union1 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = MergeTree(date, (a, date), 8192);
|
||||
CREATE TABLE test.union2 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost, 'test', 'union1');
|
||||
CREATE TABLE test.union3 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost, 'test', 'union2');
|
||||
CREATE TABLE union1 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = MergeTree(date, (a, date), 8192);
|
||||
CREATE TABLE union2 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost, currentDatabase(), 'union1');
|
||||
CREATE TABLE union3 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost, currentDatabase(), 'union2');
|
||||
|
||||
INSERT INTO test.union1 VALUES (1, 2, 3, 4, 5);
|
||||
INSERT INTO test.union1 VALUES (11,12,13,14,15);
|
||||
INSERT INTO test.union2 VALUES (21,22,23,24,25);
|
||||
INSERT INTO test.union3 VALUES (31,32,33,34,35);
|
||||
INSERT INTO union1 VALUES (1, 2, 3, 4, 5);
|
||||
INSERT INTO union1 VALUES (11,12,13,14,15);
|
||||
INSERT INTO union2 VALUES (21,22,23,24,25);
|
||||
INSERT INTO union3 VALUES (31,32,33,34,35);
|
||||
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from test.union2 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from test.union2 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from test.union1 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from test.union2 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from test.union1 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from test.union1 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from test.union2 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from test.union3 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from union2 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from union2 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from union1 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from union2 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from union1 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from union1 where b>1 group by a, b ) as a group by b;
|
||||
select b, sum(c) from ( select a, b, sum(c) as c from union2 where a>1 group by a,b UNION ALL select a, b, sum(c) as c from union3 where b>1 group by a, b ) as a group by b;
|
||||
|
||||
DROP TABLE test.union1;
|
||||
DROP TABLE test.union2;
|
||||
DROP TABLE test.union3;
|
||||
DROP TABLE union1;
|
||||
DROP TABLE union2;
|
||||
DROP TABLE union3;
|
||||
|
@ -1,12 +1,12 @@
|
||||
drop table if exists test.tab;
|
||||
create table test.tab (date Date, val UInt64, val2 UInt8 default 42, val3 UInt8 default val2 + 1, val4 UInt64 alias val) engine = MergeTree(date, (date, val), 8192);
|
||||
desc test.tab;
|
||||
drop table if exists tab;
|
||||
create table tab (date Date, val UInt64, val2 UInt8 default 42, val3 UInt8 default val2 + 1, val4 UInt64 alias val) engine = MergeTree(date, (date, val), 8192);
|
||||
desc tab;
|
||||
select '-';
|
||||
desc table test.tab;
|
||||
desc table tab;
|
||||
select '-';
|
||||
desc remote('127.0.0.2', test.tab);
|
||||
desc remote('127.0.0.2', currentDatabase(), tab);
|
||||
select '-';
|
||||
desc table remote('127.0.0.2', test.tab);
|
||||
desc table remote('127.0.0.2', currentDatabase(), tab);
|
||||
select '-';
|
||||
desc (select 1);
|
||||
select '-';
|
||||
@ -14,4 +14,4 @@ desc table (select 1);
|
||||
select '-';
|
||||
desc (select * from system.numbers);
|
||||
select '-';
|
||||
drop table if exists test.tab;
|
||||
drop table if exists tab;
|
||||
|
@ -1,19 +1,19 @@
|
||||
DROP TABLE IF EXISTS test.nums;
|
||||
DROP TABLE IF EXISTS test.nums_buf;
|
||||
DROP TABLE IF EXISTS nums;
|
||||
DROP TABLE IF EXISTS nums_buf;
|
||||
|
||||
SET insert_allow_materialized_columns = 1;
|
||||
|
||||
CREATE TABLE test.nums ( n UInt64, m UInt64 MATERIALIZED n+1 ) ENGINE = Log;
|
||||
CREATE TABLE test.nums_buf AS test.nums ENGINE = Buffer(test, nums, 1, 10, 100, 1, 3, 10000000, 100000000);
|
||||
CREATE TABLE nums ( n UInt64, m UInt64 MATERIALIZED n+1 ) ENGINE = Log;
|
||||
CREATE TABLE nums_buf AS nums ENGINE = Buffer(currentDatabase(), nums, 1, 10, 100, 1, 3, 10000000, 100000000);
|
||||
|
||||
INSERT INTO test.nums_buf (n) VALUES (1);
|
||||
INSERT INTO test.nums_buf (n) VALUES (2);
|
||||
INSERT INTO test.nums_buf (n) VALUES (3);
|
||||
INSERT INTO test.nums_buf (n) VALUES (4);
|
||||
INSERT INTO test.nums_buf (n) VALUES (5);
|
||||
INSERT INTO nums_buf (n) VALUES (1);
|
||||
INSERT INTO nums_buf (n) VALUES (2);
|
||||
INSERT INTO nums_buf (n) VALUES (3);
|
||||
INSERT INTO nums_buf (n) VALUES (4);
|
||||
INSERT INTO nums_buf (n) VALUES (5);
|
||||
|
||||
SELECT n,m FROM test.nums ORDER BY n;
|
||||
SELECT n,m FROM test.nums_buf ORDER BY n;
|
||||
SELECT n,m FROM nums ORDER BY n;
|
||||
SELECT n,m FROM nums_buf ORDER BY n;
|
||||
|
||||
DROP TABLE IF EXISTS test.nums_buf;
|
||||
DROP TABLE IF EXISTS test.nums;
|
||||
DROP TABLE IF EXISTS nums_buf;
|
||||
DROP TABLE IF EXISTS nums;
|
||||
|
@ -1,8 +1,7 @@
|
||||
create database if not exists test;
|
||||
drop table if exists test.tab;
|
||||
create table test.tab (val UInt8) engine = MergeTree order by val;
|
||||
insert into function remote('127.0.0.2', test.tab) values (1);
|
||||
insert into function remote('127.0.0.{2|3}', test.tab) values (2);
|
||||
insert into function remote('127.0.0.{2|3|4}', test.tab) values (3);
|
||||
select * from test.tab order by val;
|
||||
|
||||
drop table if exists tab;
|
||||
create table tab (val UInt8) engine = MergeTree order by val;
|
||||
insert into function remote('127.0.0.2', currentDatabase(), tab) values (1);
|
||||
insert into function remote('127.0.0.{2|3}', currentDatabase(), tab) values (2);
|
||||
insert into function remote('127.0.0.{2|3|4}', currentDatabase(), tab) values (3);
|
||||
select * from tab order by val;
|
||||
drop table tab;
|
||||
|
@ -5,4 +5,4 @@ insert into tab_00577 values ('2018-01-01', 0, 0);
|
||||
select * from tab_00577 order by version;
|
||||
OPTIMIZE TABLE tab_00577;
|
||||
select * from tab_00577;
|
||||
|
||||
drop table tab_00577;
|
||||
|
@ -1,42 +1,42 @@
|
||||
DROP TABLE IF EXISTS test.numbers1;
|
||||
DROP TABLE IF EXISTS test.numbers2;
|
||||
DROP TABLE IF EXISTS test.numbers3;
|
||||
DROP TABLE IF EXISTS test.numbers4;
|
||||
DROP TABLE IF EXISTS test.numbers5;
|
||||
DROP TABLE IF EXISTS numbers1;
|
||||
DROP TABLE IF EXISTS numbers2;
|
||||
DROP TABLE IF EXISTS numbers3;
|
||||
DROP TABLE IF EXISTS numbers4;
|
||||
DROP TABLE IF EXISTS numbers5;
|
||||
|
||||
CREATE TABLE test.numbers1 ENGINE = StripeLog AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE test.numbers2 ENGINE = TinyLog AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE test.numbers3 ENGINE = Log AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE test.numbers4 ENGINE = Memory AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE test.numbers5 ENGINE = MergeTree ORDER BY number AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers1 ENGINE = StripeLog AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers2 ENGINE = TinyLog AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers3 ENGINE = Log AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers4 ENGINE = Memory AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers5 ENGINE = MergeTree ORDER BY number AS SELECT number FROM numbers(1000);
|
||||
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$');
|
||||
SELECT DISTINCT count() FROM merge(test, '^numbers\\d+$') GROUP BY number;
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$');
|
||||
SELECT DISTINCT count() FROM merge(currentDatabase(), '^numbers\\d+$') GROUP BY number;
|
||||
|
||||
SET max_rows_to_read = 1000;
|
||||
|
||||
SET max_threads = 'auto';
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$') WHERE _table = 'numbers1';
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$') WHERE _table = 'numbers1';
|
||||
|
||||
SET max_threads = 1;
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$') WHERE _table = 'numbers2';
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$') WHERE _table = 'numbers2';
|
||||
|
||||
SET max_threads = 10;
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$') WHERE _table = 'numbers3';
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$') WHERE _table = 'numbers3';
|
||||
|
||||
SET max_rows_to_read = 1;
|
||||
|
||||
SET max_threads = 'auto';
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$') WHERE _table = 'non_existing';
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$') WHERE _table = 'non_existing';
|
||||
|
||||
SET max_threads = 1;
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$') WHERE _table = 'non_existing';
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$') WHERE _table = 'non_existing';
|
||||
|
||||
SET max_threads = 10;
|
||||
SELECT count() FROM merge(test, '^numbers\\d+$') WHERE _table = 'non_existing';
|
||||
SELECT count() FROM merge(currentDatabase(), '^numbers\\d+$') WHERE _table = 'non_existing';
|
||||
|
||||
DROP TABLE test.numbers1;
|
||||
DROP TABLE test.numbers2;
|
||||
DROP TABLE test.numbers3;
|
||||
DROP TABLE test.numbers4;
|
||||
DROP TABLE test.numbers5;
|
||||
DROP TABLE numbers1;
|
||||
DROP TABLE numbers2;
|
||||
DROP TABLE numbers3;
|
||||
DROP TABLE numbers4;
|
||||
DROP TABLE numbers5;
|
||||
|
@ -1,18 +1,18 @@
|
||||
DROP TABLE IF EXISTS test.numbers1;
|
||||
DROP TABLE IF EXISTS test.numbers2;
|
||||
DROP TABLE IF EXISTS numbers1;
|
||||
DROP TABLE IF EXISTS numbers2;
|
||||
|
||||
CREATE TABLE test.numbers1 ENGINE = Memory AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE test.numbers2 ENGINE = Memory AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers1 ENGINE = Memory AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers2 ENGINE = Memory AS SELECT number FROM numbers(1000);
|
||||
|
||||
SELECT * FROM merge(test, '^numbers\\d+$') SAMPLE 0.1; -- { serverError 141 }
|
||||
SELECT * FROM merge(currentDatabase(), '^numbers\\d+$') SAMPLE 0.1; -- { serverError 141 }
|
||||
|
||||
DROP TABLE test.numbers1;
|
||||
DROP TABLE test.numbers2;
|
||||
DROP TABLE numbers1;
|
||||
DROP TABLE numbers2;
|
||||
|
||||
CREATE TABLE test.numbers1 ENGINE = MergeTree ORDER BY intHash32(number) SAMPLE BY intHash32(number) AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE test.numbers2 ENGINE = MergeTree ORDER BY intHash32(number) SAMPLE BY intHash32(number) AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers1 ENGINE = MergeTree ORDER BY intHash32(number) SAMPLE BY intHash32(number) AS SELECT number FROM numbers(1000);
|
||||
CREATE TABLE numbers2 ENGINE = MergeTree ORDER BY intHash32(number) SAMPLE BY intHash32(number) AS SELECT number FROM numbers(1000);
|
||||
|
||||
SELECT * FROM merge(test, '^numbers\\d+$') SAMPLE 0.01;
|
||||
SELECT * FROM merge(currentDatabase(), '^numbers\\d+$') SAMPLE 0.01;
|
||||
|
||||
DROP TABLE test.numbers1;
|
||||
DROP TABLE test.numbers2;
|
||||
DROP TABLE numbers1;
|
||||
DROP TABLE numbers2;
|
||||
|
@ -1,18 +1,18 @@
|
||||
DROP TABLE IF EXISTS test.sample_00579_1;
|
||||
DROP TABLE IF EXISTS test.sample_00579_2;
|
||||
DROP TABLE IF EXISTS test.sample_merge_00579;
|
||||
DROP TABLE IF EXISTS sample_00579_1;
|
||||
DROP TABLE IF EXISTS sample_00579_2;
|
||||
DROP TABLE IF EXISTS sample_merge_00579;
|
||||
|
||||
CREATE TABLE test.sample_00579_1 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
CREATE TABLE test.sample_00579_2 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
CREATE TABLE sample_00579_1 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
CREATE TABLE sample_00579_2 (x UInt64, d Date DEFAULT today()) ENGINE = MergeTree(d, intHash64(x), intHash64(x), 10);
|
||||
|
||||
INSERT INTO test.sample_00579_1 (x) SELECT number AS x FROM system.numbers LIMIT 1000;
|
||||
INSERT INTO test.sample_00579_2 (x) SELECT number AS x FROM system.numbers LIMIT 2000;
|
||||
INSERT INTO sample_00579_1 (x) SELECT number AS x FROM system.numbers LIMIT 1000;
|
||||
INSERT INTO sample_00579_2 (x) SELECT number AS x FROM system.numbers LIMIT 2000;
|
||||
|
||||
CREATE TABLE test.sample_merge_00579 AS test.sample_00579_1 ENGINE = Merge(test, '^sample_00579_\\d$');
|
||||
CREATE TABLE sample_merge_00579 AS sample_00579_1 ENGINE = Merge(currentDatabase(), '^sample_00579_\\d$');
|
||||
|
||||
SET max_threads = 1;
|
||||
SELECT _sample_factor FROM merge(test, '^sample_00579_\\d$');
|
||||
SELECT _sample_factor FROM merge(currentDatabase(), '^sample_00579_\\d$');
|
||||
|
||||
DROP TABLE test.sample_00579_1;
|
||||
DROP TABLE test.sample_00579_2;
|
||||
DROP TABLE test.sample_merge_00579;
|
||||
DROP TABLE sample_00579_1;
|
||||
DROP TABLE sample_00579_2;
|
||||
DROP TABLE sample_merge_00579;
|
||||
|
@ -1,11 +1,11 @@
|
||||
DROP TABLE IF EXISTS test.local_statements;
|
||||
DROP TABLE IF EXISTS test.statements;
|
||||
DROP TABLE IF EXISTS local_statements;
|
||||
DROP TABLE IF EXISTS statements;
|
||||
|
||||
CREATE TABLE test.local_statements ( statementId String, eventDate Date, eventHour DateTime, eventTime DateTime, verb String, objectId String, onCourse UInt8, courseId UInt16, contextRegistration String, resultScoreRaw Float64, resultScoreMin Float64, resultScoreMax Float64, resultSuccess UInt8, resultCompletition UInt8, resultDuration UInt32, resultResponse String, learnerId String, learnerHash String, contextId UInt16) ENGINE = MergeTree ORDER BY tuple();
|
||||
CREATE TABLE local_statements ( statementId String, eventDate Date, eventHour DateTime, eventTime DateTime, verb String, objectId String, onCourse UInt8, courseId UInt16, contextRegistration String, resultScoreRaw Float64, resultScoreMin Float64, resultScoreMax Float64, resultSuccess UInt8, resultCompletition UInt8, resultDuration UInt32, resultResponse String, learnerId String, learnerHash String, contextId UInt16) ENGINE = MergeTree ORDER BY tuple();
|
||||
|
||||
CREATE TABLE test.statements ( statementId String, eventDate Date, eventHour DateTime, eventTime DateTime, verb String, objectId String, onCourse UInt8, courseId UInt16, contextRegistration String, resultScoreRaw Float64, resultScoreMin Float64, resultScoreMax Float64, resultSuccess UInt8, resultCompletition UInt8, resultDuration UInt32, resultResponse String, learnerId String, learnerHash String, contextId UInt16) ENGINE = Distributed(test_shard_localhost, 'test', 'local_statements', sipHash64(learnerHash));
|
||||
CREATE TABLE statements ( statementId String, eventDate Date, eventHour DateTime, eventTime DateTime, verb String, objectId String, onCourse UInt8, courseId UInt16, contextRegistration String, resultScoreRaw Float64, resultScoreMin Float64, resultScoreMax Float64, resultSuccess UInt8, resultCompletition UInt8, resultDuration UInt32, resultResponse String, learnerId String, learnerHash String, contextId UInt16) ENGINE = Distributed(test_shard_localhost, currentDatabase(), 'local_statements', sipHash64(learnerHash));
|
||||
|
||||
INSERT INTO test.local_statements FORMAT CSV "2b3b04ee-0bb8-4200-906f-d47c48e56bd0","2016-08-25","2016-08-25 14:00:00","2016-08-25 14:43:34","http://adlnet.gov/expapi/verbs/passed","https://crmm.ru/xapi/courses/spp/2/0/3/2/8",0,1,"c13d788c-26e0-40e3-bacb-a1ff78ee1518",100,0,0,0,0,0,"","https://sberbank-school.ru/xapi/accounts/userid/94312","6f696f938a69b5e173093718e1c2bbf2",0
|
||||
INSERT INTO local_statements FORMAT CSV "2b3b04ee-0bb8-4200-906f-d47c48e56bd0","2016-08-25","2016-08-25 14:00:00","2016-08-25 14:43:34","http://adlnet.gov/expapi/verbs/passed","https://crmm.ru/xapi/courses/spp/2/0/3/2/8",0,1,"c13d788c-26e0-40e3-bacb-a1ff78ee1518",100,0,0,0,0,0,"","https://sberbank-school.ru/xapi/accounts/userid/94312","6f696f938a69b5e173093718e1c2bbf2",0
|
||||
|
||||
SELECT avg(diff)
|
||||
FROM
|
||||
@ -16,7 +16,7 @@ FROM
|
||||
SELECT
|
||||
learnerHash,
|
||||
passed - eventTime AS diff
|
||||
FROM test.statements
|
||||
FROM statements
|
||||
GLOBAL ANY INNER JOIN
|
||||
(
|
||||
SELECT
|
||||
@ -28,7 +28,7 @@ FROM
|
||||
learnerHash,
|
||||
eventTime,
|
||||
resultScoreRaw
|
||||
FROM test.statements
|
||||
FROM statements
|
||||
WHERE (courseId = 1) AND (onCourse = 0)
|
||||
AND (verb = 'http://adlnet.gov/expapi/verbs/passed') AND (objectId = 'https://crmm.ru/xapi/courses/spp/1/1/0-1')
|
||||
ORDER BY eventTime ASC
|
||||
@ -44,5 +44,5 @@ FROM
|
||||
LIMIT 7, 126
|
||||
);
|
||||
|
||||
DROP TABLE test.local_statements;
|
||||
DROP TABLE test.statements;
|
||||
DROP TABLE local_statements;
|
||||
DROP TABLE statements;
|
||||
|
@ -1,7 +1,7 @@
|
||||
DROP TABLE IF EXISTS test.alias_local10;
|
||||
DROP TABLE IF EXISTS test.alias10;
|
||||
DROP TABLE IF EXISTS alias_local10;
|
||||
DROP TABLE IF EXISTS alias10;
|
||||
|
||||
CREATE TABLE test.alias_local10 (
|
||||
CREATE TABLE alias_local10 (
|
||||
Id Int8,
|
||||
EventDate Date DEFAULT '2000-01-01',
|
||||
field1 Int8,
|
||||
@ -9,52 +9,52 @@ CREATE TABLE test.alias_local10 (
|
||||
field3 ALIAS CASE WHEN field1 = 1 THEN field2 ELSE '0' END
|
||||
) ENGINE = MergeTree(EventDate, (Id, EventDate), 8192);
|
||||
|
||||
CREATE TABLE test.alias10 AS test.alias_local10 ENGINE = Distributed(test_shard_localhost, test, alias_local10, cityHash64(Id));
|
||||
CREATE TABLE alias10 AS alias_local10 ENGINE = Distributed(test_shard_localhost, currentDatabase(), alias_local10, cityHash64(Id));
|
||||
|
||||
INSERT INTO test.alias_local10 (Id, EventDate, field1, field2) VALUES (1, '2000-01-01', 1, '12345'), (2, '2000-01-01', 2, '54321'), (3, '2000-01-01', 0, '');
|
||||
INSERT INTO alias_local10 (Id, EventDate, field1, field2) VALUES (1, '2000-01-01', 1, '12345'), (2, '2000-01-01', 2, '54321'), (3, '2000-01-01', 0, '');
|
||||
|
||||
SELECT field1, field2, field3 FROM test.alias_local10;
|
||||
SELECT field1, field2, field3 FROM test.alias_local10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM test.alias_local10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2, field3 FROM alias_local10;
|
||||
SELECT field1, field2, field3 FROM alias_local10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM alias_local10 WHERE EventDate='2000-01-01';
|
||||
|
||||
SELECT field1, field2, field3 FROM test.alias10;
|
||||
SELECT field1, field2, field3 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2, field3 FROM alias10;
|
||||
SELECT field1, field2, field3 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
|
||||
SELECT field2, field3 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field3 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field2, field3 FROM test.alias10;
|
||||
SELECT field3 FROM test.alias10;
|
||||
SELECT field2, field3 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field3 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field2, field3 FROM alias10;
|
||||
SELECT field3 FROM alias10;
|
||||
|
||||
SELECT field1 FROM test.alias10 WHERE field3 = '12345';
|
||||
SELECT field2 FROM test.alias10 WHERE field3 = '12345';
|
||||
SELECT field3 FROM test.alias10 WHERE field3 = '12345';
|
||||
SELECT field1 FROM alias10 WHERE field3 = '12345';
|
||||
SELECT field2 FROM alias10 WHERE field3 = '12345';
|
||||
SELECT field3 FROM alias10 WHERE field3 = '12345';
|
||||
|
||||
DROP TABLE test.alias10;
|
||||
CREATE TABLE test.alias10 (
|
||||
DROP TABLE alias10;
|
||||
CREATE TABLE alias10 (
|
||||
Id Int8,
|
||||
EventDate Date,
|
||||
field1 Int8,
|
||||
field2 String,
|
||||
field3 String
|
||||
) ENGINE = Distributed(test_shard_localhost, test, alias_local10);
|
||||
) ENGINE = Distributed(test_shard_localhost, currentDatabase(), alias_local10);
|
||||
|
||||
SELECT field1, field2, field3 FROM test.alias_local10;
|
||||
SELECT field1, field2, field3 FROM test.alias_local10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM test.alias_local10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2, field3 FROM alias_local10;
|
||||
SELECT field1, field2, field3 FROM alias_local10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM alias_local10 WHERE EventDate='2000-01-01';
|
||||
|
||||
SELECT field1, field2, field3 FROM test.alias10;
|
||||
SELECT field1, field2, field3 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2, field3 FROM alias10;
|
||||
SELECT field1, field2, field3 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field1, field2 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
|
||||
SELECT field2, field3 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field3 FROM test.alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field2, field3 FROM test.alias10;
|
||||
SELECT field3 FROM test.alias10;
|
||||
SELECT field2, field3 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field3 FROM alias10 WHERE EventDate='2000-01-01';
|
||||
SELECT field2, field3 FROM alias10;
|
||||
SELECT field3 FROM alias10;
|
||||
|
||||
SELECT field1 FROM test.alias10 WHERE field3 = '12345';
|
||||
SELECT field2 FROM test.alias10 WHERE field3 = '12345';
|
||||
SELECT field3 FROM test.alias10 WHERE field3 = '12345';
|
||||
SELECT field1 FROM alias10 WHERE field3 = '12345';
|
||||
SELECT field2 FROM alias10 WHERE field3 = '12345';
|
||||
SELECT field3 FROM alias10 WHERE field3 = '12345';
|
||||
|
||||
DROP TABLE test.alias_local10;
|
||||
DROP TABLE test.alias10;
|
||||
DROP TABLE alias_local10;
|
||||
DROP TABLE alias10;
|
||||
|
@ -21,42 +21,42 @@ SELECT id\nFROM \n(\n SELECT arrayJoin([1, 2, 3]) AS id\n WHERE id = 1\n)
|
||||
1
|
||||
SELECT \n id, \n subquery\nFROM \n(\n SELECT \n 1 AS id, \n CAST(1, \'UInt8\') AS subquery\n WHERE subquery = 1\n) \nWHERE subquery = 1
|
||||
1 1
|
||||
SELECT \n a, \n b\nFROM \n(\n SELECT \n toUInt64(sum(id) AS b) AS a, \n b\n FROM test.test_00597 \n HAVING a = 3\n) \nWHERE a = 3
|
||||
SELECT \n a, \n b\nFROM \n(\n SELECT \n toUInt64(sum(id) AS b) AS a, \n b\n FROM test_00597 \n HAVING a = 3\n) \nWHERE a = 3
|
||||
3 3
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n name, \n value, \n min(id) AS id\n FROM test.test_00597 \n GROUP BY \n date, \n name, \n value\n HAVING id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n name, \n value, \n min(id) AS id\n FROM test_00597 \n GROUP BY \n date, \n name, \n value\n HAVING id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n a, \n b\nFROM \n(\n SELECT \n toUInt64(sum(id) AS b) AS a, \n b\n FROM test.test_00597 AS table_alias \n HAVING b = 3\n) AS outer_table_alias \nWHERE b = 3
|
||||
SELECT \n a, \n b\nFROM \n(\n SELECT \n toUInt64(sum(id) AS b) AS a, \n b\n FROM test_00597 AS table_alias \n HAVING b = 3\n) AS outer_table_alias \nWHERE b = 3
|
||||
3 3
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n ) \n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n ) \n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n ) AS b \n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n ) AS b \n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n ) \n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n ) \n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n) AS b \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n) AS b \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n ) AS a \n WHERE id = 1\n) AS b \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n ) AS a \n WHERE id = 1\n) AS b \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n id, \n date, \n value\nFROM \n(\n SELECT \n id, \n date, \n min(value) AS value\n FROM test.test_00597 \n WHERE id = 1\n GROUP BY \n id, \n date\n) \nWHERE id = 1
|
||||
SELECT \n id, \n date, \n value\nFROM \n(\n SELECT \n id, \n date, \n min(value) AS value\n FROM test_00597 \n WHERE id = 1\n GROUP BY \n id, \n date\n) \nWHERE id = 1
|
||||
1 2000-01-01 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n UNION ALL\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n UNION ALL\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value, \n date, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test.test_00597 \n) USING (id)\nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value, \n date, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test_00597 \n) USING (id)\nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 test string 1 1
|
||||
SELECT \n id, \n date, \n name, \n value\nFROM \n(\n SELECT toInt8(1) AS id\n) \nANY LEFT JOIN test.test_00597 USING (id)\nWHERE value = 1
|
||||
SELECT \n id, \n date, \n name, \n value\nFROM \n(\n SELECT toInt8(1) AS id\n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test_00597 \n) AS test_00597 USING (id)\nWHERE value = 1
|
||||
1 2000-01-01 test string 1 1
|
||||
SELECT value\nFROM \n(\n SELECT toInt8(1) AS id\n) \nANY LEFT JOIN test.test_00597 AS b USING (id)\nWHERE value = 1
|
||||
SELECT value\nFROM \n(\n SELECT toInt8(1) AS id\n) \nANY LEFT JOIN test_00597 AS b USING (id)\nWHERE value = 1
|
||||
1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value, \n date, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n ) \n ANY LEFT JOIN \n (\n SELECT *\n FROM test.test_00597 \n ) USING (id)\n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value, \n date, \n name, \n value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n ) \n ANY LEFT JOIN \n (\n SELECT *\n FROM test_00597 \n ) USING (id)\n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value, \n b.date, \n b.name, \n b.value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test.test_00597 \n) AS b USING (id)\nWHERE b.id = 1
|
||||
SELECT \n date, \n id, \n name, \n value, \n b.date, \n b.name, \n b.value\nFROM \n(\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test_00597 \n) AS b USING (id)\nWHERE b.id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 test string 1 1
|
||||
SELECT \n id, \n date, \n name, \n value\nFROM \n(\n SELECT \n toInt8(1) AS id, \n toDate(\'2000-01-01\') AS date\n FROM system.numbers \n LIMIT 1\n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test.test_00597 \n) AS b USING (date, id)\nWHERE b.date = toDate(\'2000-01-01\')
|
||||
SELECT \n id, \n date, \n name, \n value\nFROM \n(\n SELECT \n toInt8(1) AS id, \n toDate(\'2000-01-01\') AS date\n FROM system.numbers \n LIMIT 1\n) \nANY LEFT JOIN \n(\n SELECT *\n FROM test_00597 \n) AS b USING (date, id)\nWHERE b.date = toDate(\'2000-01-01\')
|
||||
1 2000-01-01 test string 1 1
|
||||
SELECT \n date, \n id, \n name, \n value, \n `b.date`, \n `b.id`, \n `b.name`, \n `b.value`\nFROM \n(\n SELECT \n date, \n id, \n name, \n value, \n b.date, \n b.id, \n b.name, \n b.value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test.test_00597 \n WHERE id = 1\n ) AS a \n ANY LEFT JOIN \n (\n SELECT *\n FROM test.test_00597 \n ) AS b ON id = b.id\n WHERE id = 1\n) \nWHERE id = 1
|
||||
SELECT \n date, \n id, \n name, \n value, \n `b.date`, \n `b.id`, \n `b.name`, \n `b.value`\nFROM \n(\n SELECT \n date, \n id, \n name, \n value, \n b.date, \n b.id, \n b.name, \n b.value\n FROM \n (\n SELECT \n date, \n id, \n name, \n value\n FROM test_00597 \n WHERE id = 1\n ) AS a \n ANY LEFT JOIN \n (\n SELECT *\n FROM test_00597 \n ) AS b ON id = b.id\n WHERE id = 1\n) \nWHERE id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 1 test string 1 1
|
||||
|
@ -1,13 +1,13 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.test_00597;
|
||||
DROP TABLE IF EXISTS test.test_view_00597;
|
||||
DROP TABLE IF EXISTS test_00597;
|
||||
DROP TABLE IF EXISTS test_view_00597;
|
||||
|
||||
CREATE TABLE test.test_00597(date Date, id Int8, name String, value Int64) ENGINE = MergeTree(date, (id, date), 8192);
|
||||
CREATE VIEW test.test_view_00597 AS SELECT * FROM test.test_00597;
|
||||
CREATE TABLE test_00597(date Date, id Int8, name String, value Int64) ENGINE = MergeTree(date, (id, date), 8192);
|
||||
CREATE VIEW test_view_00597 AS SELECT * FROM test_00597;
|
||||
|
||||
INSERT INTO test.test_00597 VALUES('2000-01-01', 1, 'test string 1', 1);
|
||||
INSERT INTO test.test_00597 VALUES('2000-01-01', 2, 'test string 2', 2);
|
||||
INSERT INTO test_00597 VALUES('2000-01-01', 1, 'test string 1', 1);
|
||||
INSERT INTO test_00597 VALUES('2000-01-01', 2, 'test string 2', 2);
|
||||
|
||||
SET enable_optimize_predicate_expression = 1;
|
||||
SET enable_debug_queries = 1;
|
||||
@ -16,7 +16,7 @@ SELECT '-------No need for predicate optimization, but still works-------';
|
||||
SELECT 1;
|
||||
SELECT 1 AS id WHERE id = 1;
|
||||
SELECT arrayJoin([1,2,3]) AS id WHERE id = 1;
|
||||
SELECT * FROM test.test_00597 WHERE id = 1;
|
||||
SELECT * FROM test_00597 WHERE id = 1;
|
||||
|
||||
SELECT '-------Forbid push down-------';
|
||||
|
||||
@ -57,76 +57,76 @@ ANALYZE SELECT * FROM (SELECT 1 AS id, (SELECT 1) as subquery) WHERE subquery =
|
||||
SELECT * FROM (SELECT 1 AS id, (SELECT 1) as subquery) WHERE subquery = 1;
|
||||
|
||||
-- Optimize predicate expressions using tables
|
||||
ANALYZE SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test.test_00597) WHERE a = 3;
|
||||
SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test.test_00597) WHERE a = 3;
|
||||
ANALYZE SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test_00597) WHERE a = 3;
|
||||
SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test_00597) WHERE a = 3;
|
||||
|
||||
ANALYZE SELECT date, id, name, value FROM (SELECT date, name, value, min(id) AS id FROM test.test_00597 GROUP BY date, name, value) WHERE id = 1;
|
||||
SELECT date, id, name, value FROM (SELECT date, name, value, min(id) AS id FROM test.test_00597 GROUP BY date, name, value) WHERE id = 1;
|
||||
ANALYZE SELECT date, id, name, value FROM (SELECT date, name, value, min(id) AS id FROM test_00597 GROUP BY date, name, value) WHERE id = 1;
|
||||
SELECT date, id, name, value FROM (SELECT date, name, value, min(id) AS id FROM test_00597 GROUP BY date, name, value) WHERE id = 1;
|
||||
|
||||
ANALYZE SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test.test_00597 AS table_alias) AS outer_table_alias WHERE outer_table_alias.b = 3;
|
||||
SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test.test_00597 AS table_alias) AS outer_table_alias WHERE outer_table_alias.b = 3;
|
||||
ANALYZE SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test_00597 AS table_alias) AS outer_table_alias WHERE outer_table_alias.b = 3;
|
||||
SELECT * FROM (SELECT toUInt64(b) AS a, sum(id) AS b FROM test_00597 AS table_alias) AS outer_table_alias WHERE outer_table_alias.b = 3;
|
||||
|
||||
-- Optimize predicate expression with asterisk
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test.test_00597) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM test.test_00597) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test_00597) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM test_00597) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression with asterisk and nested subquery
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597)) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597)) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597)) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597)) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression with qualified asterisk
|
||||
ANALYZE SELECT * FROM (SELECT b.* FROM (SELECT * FROM test.test_00597) AS b) WHERE id = 1;
|
||||
SELECT * FROM (SELECT b.* FROM (SELECT * FROM test.test_00597) AS b) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT b.* FROM (SELECT * FROM test_00597) AS b) WHERE id = 1;
|
||||
SELECT * FROM (SELECT b.* FROM (SELECT * FROM test_00597) AS b) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression without asterisk
|
||||
ANALYZE SELECT * FROM (SELECT date, id, name, value FROM test.test_00597) WHERE id = 1;
|
||||
SELECT * FROM (SELECT date, id, name, value FROM test.test_00597) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT date, id, name, value FROM test_00597) WHERE id = 1;
|
||||
SELECT * FROM (SELECT date, id, name, value FROM test_00597) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression without asterisk and contains nested subquery
|
||||
ANALYZE SELECT * FROM (SELECT date, id, name, value FROM (SELECT date, id, name, value FROM test.test_00597)) WHERE id = 1;
|
||||
SELECT * FROM (SELECT date, id, name, value FROM (SELECT date, id, name, value FROM test.test_00597)) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT date, id, name, value FROM (SELECT date, id, name, value FROM test_00597)) WHERE id = 1;
|
||||
SELECT * FROM (SELECT date, id, name, value FROM (SELECT date, id, name, value FROM test_00597)) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression with qualified
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test.test_00597) AS b WHERE b.id = 1;
|
||||
SELECT * FROM (SELECT * FROM test.test_00597) AS b WHERE b.id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test_00597) AS b WHERE b.id = 1;
|
||||
SELECT * FROM (SELECT * FROM test_00597) AS b WHERE b.id = 1;
|
||||
|
||||
-- Optimize predicate expression with qualified and nested subquery
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597) AS a) AS b WHERE b.id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597) AS a) AS b WHERE b.id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597) AS a) AS b WHERE b.id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597) AS a) AS b WHERE b.id = 1;
|
||||
|
||||
-- Optimize predicate expression with aggregate function
|
||||
ANALYZE SELECT * FROM (SELECT id, date, min(value) AS value FROM test.test_00597 GROUP BY id, date) WHERE id = 1;
|
||||
SELECT * FROM (SELECT id, date, min(value) AS value FROM test.test_00597 GROUP BY id, date) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT id, date, min(value) AS value FROM test_00597 GROUP BY id, date) WHERE id = 1;
|
||||
SELECT * FROM (SELECT id, date, min(value) AS value FROM test_00597 GROUP BY id, date) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression with union all query
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test.test_00597 UNION ALL SELECT * FROM test.test_00597) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM test.test_00597 UNION ALL SELECT * FROM test.test_00597) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test_00597 UNION ALL SELECT * FROM test_00597) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM test_00597 UNION ALL SELECT * FROM test_00597) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression with join query
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test.test_00597) ANY LEFT JOIN (SELECT * FROM test.test_00597) USING id WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM test.test_00597) ANY LEFT JOIN (SELECT * FROM test.test_00597) USING id WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test_00597) ANY LEFT JOIN (SELECT * FROM test_00597) USING id WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM test_00597) ANY LEFT JOIN (SELECT * FROM test_00597) USING id WHERE id = 1;
|
||||
|
||||
ANALYZE SELECT * FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test.test_00597 USING id WHERE value = 1;
|
||||
SELECT * FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test.test_00597 USING id WHERE value = 1;
|
||||
ANALYZE SELECT * FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test_00597 USING id WHERE value = 1;
|
||||
SELECT * FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test_00597 USING id WHERE value = 1;
|
||||
|
||||
-- FIXME: no support for aliased tables for now.
|
||||
ANALYZE SELECT b.value FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test.test_00597 AS b USING id WHERE value = 1;
|
||||
SELECT b.value FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test.test_00597 AS b USING id WHERE value = 1;
|
||||
ANALYZE SELECT b.value FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test_00597 AS b USING id WHERE value = 1;
|
||||
SELECT b.value FROM (SELECT toInt8(1) AS id) ANY LEFT JOIN test_00597 AS b USING id WHERE value = 1;
|
||||
|
||||
-- Optimize predicate expression with join and nested subquery
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597) ANY LEFT JOIN (SELECT * FROM test.test_00597) USING id) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597) ANY LEFT JOIN (SELECT * FROM test.test_00597) USING id) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597) ANY LEFT JOIN (SELECT * FROM test_00597) USING id) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597) ANY LEFT JOIN (SELECT * FROM test_00597) USING id) WHERE id = 1;
|
||||
|
||||
-- Optimize predicate expression with join query and qualified
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test.test_00597) ANY LEFT JOIN (SELECT * FROM test.test_00597) AS b USING id WHERE b.id = 1;
|
||||
SELECT * FROM (SELECT * FROM test.test_00597) ANY LEFT JOIN (SELECT * FROM test.test_00597) AS b USING id WHERE b.id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM test_00597) ANY LEFT JOIN (SELECT * FROM test_00597) AS b USING id WHERE b.id = 1;
|
||||
SELECT * FROM (SELECT * FROM test_00597) ANY LEFT JOIN (SELECT * FROM test_00597) AS b USING id WHERE b.id = 1;
|
||||
|
||||
-- Compatibility test
|
||||
ANALYZE SELECT * FROM (SELECT toInt8(1) AS id, toDate('2000-01-01') AS date FROM system.numbers LIMIT 1) ANY LEFT JOIN (SELECT * FROM test.test_00597) AS b USING date, id WHERE b.date = toDate('2000-01-01');
|
||||
SELECT * FROM (SELECT toInt8(1) AS id, toDate('2000-01-01') AS date FROM system.numbers LIMIT 1) ANY LEFT JOIN (SELECT * FROM test.test_00597) AS b USING date, id WHERE b.date = toDate('2000-01-01');
|
||||
ANALYZE SELECT * FROM (SELECT toInt8(1) AS id, toDate('2000-01-01') AS date FROM system.numbers LIMIT 1) ANY LEFT JOIN (SELECT * FROM test_00597) AS b USING date, id WHERE b.date = toDate('2000-01-01');
|
||||
SELECT * FROM (SELECT toInt8(1) AS id, toDate('2000-01-01') AS date FROM system.numbers LIMIT 1) ANY LEFT JOIN (SELECT * FROM test_00597) AS b USING date, id WHERE b.date = toDate('2000-01-01');
|
||||
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597) AS a ANY LEFT JOIN (SELECT * FROM test.test_00597) AS b ON a.id = b.id) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test.test_00597) AS a ANY LEFT JOIN (SELECT * FROM test.test_00597) AS b ON a.id = b.id) WHERE id = 1;
|
||||
ANALYZE SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597) AS a ANY LEFT JOIN (SELECT * FROM test_00597) AS b ON a.id = b.id) WHERE id = 1;
|
||||
SELECT * FROM (SELECT * FROM (SELECT * FROM test_00597) AS a ANY LEFT JOIN (SELECT * FROM test_00597) AS b ON a.id = b.id) WHERE id = 1;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_00597;
|
||||
DROP TABLE IF EXISTS test.test_view_00597;
|
||||
DROP TABLE IF EXISTS test_00597;
|
||||
DROP TABLE IF EXISTS test_view_00597;
|
||||
|
@ -1 +1 @@
|
||||
CREATE VIEW test.test_view_00599 (`id` UInt64) AS SELECT * FROM test.test_00599 WHERE id = (SELECT 1)
|
||||
CREATE VIEW default.test_view_00599 (`id` UInt64) AS SELECT * FROM default.test_00599 WHERE id = (SELECT 1)
|
||||
|
@ -1,13 +1,13 @@
|
||||
DROP TABLE IF EXISTS test.test_00599;
|
||||
DROP TABLE IF EXISTS test.test_view_00599;
|
||||
DROP TABLE IF EXISTS test_00599;
|
||||
DROP TABLE IF EXISTS test_view_00599;
|
||||
|
||||
CREATE TABLE test.test_00599(id UInt64) ENGINE = Log;
|
||||
CREATE VIEW test.test_view_00599 AS SELECT * FROM test.test_00599 WHERE id = (SELECT 1);
|
||||
CREATE TABLE test_00599(id UInt64) ENGINE = Log;
|
||||
CREATE VIEW test_view_00599 AS SELECT * FROM test_00599 WHERE id = (SELECT 1);
|
||||
|
||||
DETACH TABLE test.test_view_00599;
|
||||
ATTACH TABLE test.test_view_00599;
|
||||
DETACH TABLE test_view_00599;
|
||||
ATTACH TABLE test_view_00599;
|
||||
|
||||
SHOW CREATE TABLE test.test_view_00599;
|
||||
SHOW CREATE TABLE test_view_00599;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_00599;
|
||||
DROP TABLE IF EXISTS test.test_view_00599;
|
||||
DROP TABLE IF EXISTS test_00599;
|
||||
DROP TABLE IF EXISTS test_view_00599;
|
||||
|
@ -1,38 +1,38 @@
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
DROP TABLE IF EXISTS test.t2;
|
||||
DROP TABLE IF EXISTS test.t3;
|
||||
DROP TABLE IF EXISTS test.t4;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
DROP TABLE IF EXISTS t3;
|
||||
DROP TABLE IF EXISTS t4;
|
||||
|
||||
CREATE TABLE test.t1(x UInt32, y UInt32) ENGINE TinyLog;
|
||||
CREATE TABLE test.t2(x UInt32, y UInt32 DEFAULT x + 1) ENGINE TinyLog;
|
||||
CREATE TABLE test.t3(x UInt32, y UInt32 MATERIALIZED x + 1) ENGINE TinyLog;
|
||||
CREATE TABLE test.t4(x UInt32, y UInt32 ALIAS x + 1) ENGINE TinyLog;
|
||||
CREATE TABLE t1(x UInt32, y UInt32) ENGINE TinyLog;
|
||||
CREATE TABLE t2(x UInt32, y UInt32 DEFAULT x + 1) ENGINE TinyLog;
|
||||
CREATE TABLE t3(x UInt32, y UInt32 MATERIALIZED x + 1) ENGINE TinyLog;
|
||||
CREATE TABLE t4(x UInt32, y UInt32 ALIAS x + 1) ENGINE TinyLog;
|
||||
|
||||
INSERT INTO test.t1 VALUES (1, 1);
|
||||
INSERT INTO test.t2 VALUES (1, 1);
|
||||
INSERT INTO test.t3 VALUES (1);
|
||||
INSERT INTO test.t4 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1, 1);
|
||||
INSERT INTO t2 VALUES (1, 1);
|
||||
INSERT INTO t3 VALUES (1);
|
||||
INSERT INTO t4 VALUES (1);
|
||||
|
||||
INSERT INTO FUNCTION remote('127.0.0.2', test.t1) VALUES (2, 2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.2', test.t2) VALUES (2, 2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.2', currentDatabase(), t1) VALUES (2, 2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.2', currentDatabase(), t2) VALUES (2, 2);
|
||||
--TODO: INSERT into remote tables with MATERIALIZED columns.
|
||||
--INSERT INTO FUNCTION remote('127.0.0.2', test.t3) VALUES (2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.2', test.t4) VALUES (2);
|
||||
--INSERT INTO FUNCTION remote('127.0.0.2', currentDatabase(), t3) VALUES (2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.2', currentDatabase(), t4) VALUES (2);
|
||||
|
||||
SELECT * FROM remote('127.0.0.2', test.t1) ORDER BY x;
|
||||
SELECT * FROM remote('127.0.0.2', currentDatabase(), t1) ORDER BY x;
|
||||
|
||||
SELECT '*** With a DEFAULT column ***';
|
||||
SELECT * FROM remote('127.0.0.2', test.t2) ORDER BY x;
|
||||
SELECT * FROM remote('127.0.0.2', currentDatabase(), t2) ORDER BY x;
|
||||
|
||||
SELECT '*** With a MATERIALIZED column ***';
|
||||
SELECT * FROM remote('127.0.0.2', test.t3) ORDER BY x;
|
||||
SELECT x, y FROM remote('127.0.0.2', test.t3) ORDER BY x;
|
||||
SELECT * FROM remote('127.0.0.2', currentDatabase(), t3) ORDER BY x;
|
||||
SELECT x, y FROM remote('127.0.0.2', currentDatabase(), t3) ORDER BY x;
|
||||
|
||||
SELECT '*** With an ALIAS column ***';
|
||||
SELECT * FROM remote('127.0.0.2', test.t4) ORDER BY x;
|
||||
SELECT x, y FROM remote('127.0.0.2', test.t4) ORDER BY x;
|
||||
SELECT * FROM remote('127.0.0.2', currentDatabase(), t4) ORDER BY x;
|
||||
SELECT x, y FROM remote('127.0.0.2', currentDatabase(), t4) ORDER BY x;
|
||||
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
DROP TABLE test.t3;
|
||||
DROP TABLE test.t4;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t4;
|
||||
|
@ -1 +1 @@
|
||||
CREATE DATABASE test ENGINE = Ordinary
|
||||
CREATE DATABASE test_00604 ENGINE = Ordinary
|
||||
|
@ -1,2 +1,3 @@
|
||||
create database if not exists test;
|
||||
show create database test;
|
||||
create database if not exists test_00604;
|
||||
show create database test_00604;
|
||||
drop database test_00604;
|
||||
|
@ -42,3 +42,5 @@ drop table if exists tab_00612;
|
||||
CREATE TABLE tab_00612 (key1 Int32, id1 Int64, c1 Int64) ENGINE = MergeTree PARTITION BY id1 ORDER BY (key1) ;
|
||||
insert into tab_00612 values ( -1, 1, 0 );
|
||||
SELECT count(*) FROM tab_00612 PREWHERE id1 IN (1);
|
||||
|
||||
drop table tab_00612;
|
||||
|
@ -1,7 +1,5 @@
|
||||
create database if not exists test;
|
||||
drop table if exists test.tab;
|
||||
create table test.tab (date Date, time DateTime, data String) ENGINE = MergeTree(date, (time, data), 8192);
|
||||
insert into test.tab values ('2018-01-21','2018-01-21 15:12:13','test');
|
||||
select time FROM remote('127.0.0.{1,2}', test.tab) WHERE date = '2018-01-21' limit 2;
|
||||
drop table test.tab;
|
||||
|
||||
drop table if exists tab;
|
||||
create table tab (date Date, time DateTime, data String) ENGINE = MergeTree(date, (time, data), 8192);
|
||||
insert into tab values ('2018-01-21','2018-01-21 15:12:13','test');
|
||||
select time FROM remote('127.0.0.{1,2}', currentDatabase(), tab) WHERE date = '2018-01-21' limit 2;
|
||||
drop table tab;
|
||||
|
@ -2,28 +2,30 @@ DROP TABLE IF EXISTS tab_00625;
|
||||
|
||||
CREATE TABLE tab_00625
|
||||
(
|
||||
date Date,
|
||||
key UInt32,
|
||||
date Date,
|
||||
key UInt32,
|
||||
testMap Nested(
|
||||
k UInt16,
|
||||
k UInt16,
|
||||
v UInt64)
|
||||
)
|
||||
ENGINE = SummingMergeTree(date, (date, key), 1);
|
||||
|
||||
INSERT INTO tab_00625 SELECT
|
||||
today(),
|
||||
number,
|
||||
[toUInt16(number)],
|
||||
INSERT INTO tab_00625 SELECT
|
||||
today(),
|
||||
number,
|
||||
[toUInt16(number)],
|
||||
[number]
|
||||
FROM system.numbers
|
||||
FROM system.numbers
|
||||
LIMIT 8190;
|
||||
|
||||
INSERT INTO tab_00625 SELECT
|
||||
today(),
|
||||
number + 8190,
|
||||
[toUInt16(number)],
|
||||
INSERT INTO tab_00625 SELECT
|
||||
today(),
|
||||
number + 8190,
|
||||
[toUInt16(number)],
|
||||
[number + 8190]
|
||||
FROM system.numbers
|
||||
FROM system.numbers
|
||||
LIMIT 10;
|
||||
|
||||
OPTIMIZE TABLE tab_00625;
|
||||
|
||||
DROP TABLE tab_00625;
|
||||
|
@ -1,84 +1,84 @@
|
||||
DROP TABLE IF EXISTS test.src;
|
||||
DROP TABLE IF EXISTS test.dst;
|
||||
DROP TABLE IF EXISTS src;
|
||||
DROP TABLE IF EXISTS dst;
|
||||
|
||||
CREATE TABLE test.src (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;
|
||||
CREATE TABLE test.dst (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;
|
||||
CREATE TABLE src (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;
|
||||
CREATE TABLE dst (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;
|
||||
|
||||
SELECT 'Initial';
|
||||
INSERT INTO test.src VALUES (0, '0', 1);
|
||||
INSERT INTO test.src VALUES (1, '0', 1);
|
||||
INSERT INTO test.src VALUES (1, '1', 1);
|
||||
INSERT INTO test.src VALUES (2, '0', 1);
|
||||
INSERT INTO src VALUES (0, '0', 1);
|
||||
INSERT INTO src VALUES (1, '0', 1);
|
||||
INSERT INTO src VALUES (1, '1', 1);
|
||||
INSERT INTO src VALUES (2, '0', 1);
|
||||
|
||||
INSERT INTO test.dst VALUES (0, '1', 2);
|
||||
INSERT INTO test.dst VALUES (1, '1', 2), (1, '2', 2);
|
||||
INSERT INTO test.dst VALUES (2, '1', 2);
|
||||
INSERT INTO dst VALUES (0, '1', 2);
|
||||
INSERT INTO dst VALUES (1, '1', 2), (1, '2', 2);
|
||||
INSERT INTO dst VALUES (2, '1', 2);
|
||||
|
||||
SELECT count(), sum(d) FROM test.src;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
SELECT count(), sum(d) FROM src;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
|
||||
SELECT 'REPLACE simple';
|
||||
ALTER TABLE test.dst REPLACE PARTITION 1 FROM test.src;
|
||||
ALTER TABLE test.src DROP PARTITION 1;
|
||||
SELECT count(), sum(d) FROM test.src;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
ALTER TABLE dst REPLACE PARTITION 1 FROM src;
|
||||
ALTER TABLE src DROP PARTITION 1;
|
||||
SELECT count(), sum(d) FROM src;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
|
||||
SELECT 'REPLACE empty';
|
||||
ALTER TABLE test.src DROP PARTITION 1;
|
||||
ALTER TABLE test.dst REPLACE PARTITION 1 FROM test.src;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
ALTER TABLE src DROP PARTITION 1;
|
||||
ALTER TABLE dst REPLACE PARTITION 1 FROM src;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
|
||||
SELECT 'REPLACE recursive';
|
||||
ALTER TABLE test.dst DROP PARTITION 1;
|
||||
INSERT INTO test.dst VALUES (1, '1', 2), (1, '2', 2);
|
||||
ALTER TABLE dst DROP PARTITION 1;
|
||||
INSERT INTO dst VALUES (1, '1', 2), (1, '2', 2);
|
||||
|
||||
CREATE TEMPORARY table test_block_numbers (m UInt64);
|
||||
INSERT INTO test_block_numbers SELECT max(max_block_number) AS m FROM system.parts WHERE database='test' AND table='dst' AND active AND name LIKE '1_%';
|
||||
INSERT INTO test_block_numbers SELECT max(max_block_number) AS m FROM system.parts WHERE database=currentDatabase() AND table='dst' AND active AND name LIKE '1_%';
|
||||
|
||||
ALTER TABLE test.dst REPLACE PARTITION 1 FROM test.dst;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
ALTER TABLE dst REPLACE PARTITION 1 FROM dst;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
INSERT INTO test_block_numbers SELECT max(max_block_number) AS m FROM system.parts WHERE database='test' AND table='dst' AND active AND name LIKE '1_%';
|
||||
INSERT INTO test_block_numbers SELECT max(max_block_number) AS m FROM system.parts WHERE database=currentDatabase() AND table='dst' AND active AND name LIKE '1_%';
|
||||
SELECT (max(m) - min(m) > 1) AS new_block_is_generated FROM test_block_numbers;
|
||||
DROP TEMPORARY TABLE test_block_numbers;
|
||||
|
||||
|
||||
SELECT 'ATTACH FROM';
|
||||
ALTER TABLE test.dst DROP PARTITION 1;
|
||||
DROP TABLE test.src;
|
||||
ALTER TABLE dst DROP PARTITION 1;
|
||||
DROP TABLE src;
|
||||
|
||||
CREATE TABLE test.src (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;
|
||||
INSERT INTO test.src VALUES (1, '0', 1);
|
||||
INSERT INTO test.src VALUES (1, '1', 1);
|
||||
CREATE TABLE src (p UInt64, k String, d UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY k;
|
||||
INSERT INTO src VALUES (1, '0', 1);
|
||||
INSERT INTO src VALUES (1, '1', 1);
|
||||
|
||||
SYSTEM STOP MERGES test.dst;
|
||||
INSERT INTO test.dst VALUES (1, '1', 2);
|
||||
ALTER TABLE test.dst ATTACH PARTITION 1 FROM test.src;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
SYSTEM STOP MERGES dst;
|
||||
INSERT INTO dst VALUES (1, '1', 2);
|
||||
ALTER TABLE dst ATTACH PARTITION 1 FROM src;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
|
||||
SELECT 'OPTIMIZE';
|
||||
SELECT count(), sum(d), uniqExact(_part) FROM test.dst;
|
||||
SELECT count(), sum(d), uniqExact(_part) FROM dst;
|
||||
SYSTEM START MERGES;
|
||||
SET optimize_throw_if_noop=1;
|
||||
OPTIMIZE TABLE test.dst;
|
||||
SELECT count(), sum(d), uniqExact(_part) FROM test.dst;
|
||||
OPTIMIZE TABLE dst;
|
||||
SELECT count(), sum(d), uniqExact(_part) FROM dst;
|
||||
|
||||
|
||||
SELECT 'After restart';
|
||||
DETACH TABLE test.dst;
|
||||
ATTACH TABLE test.dst;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
DETACH TABLE dst;
|
||||
ATTACH TABLE dst;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
SELECT 'DETACH+ATTACH PARTITION';
|
||||
ALTER TABLE test.dst DETACH PARTITION 0;
|
||||
ALTER TABLE test.dst DETACH PARTITION 1;
|
||||
ALTER TABLE test.dst DETACH PARTITION 2;
|
||||
ALTER TABLE test.dst ATTACH PARTITION 1;
|
||||
SELECT count(), sum(d) FROM test.dst;
|
||||
ALTER TABLE dst DETACH PARTITION 0;
|
||||
ALTER TABLE dst DETACH PARTITION 1;
|
||||
ALTER TABLE dst DETACH PARTITION 2;
|
||||
ALTER TABLE dst ATTACH PARTITION 1;
|
||||
SELECT count(), sum(d) FROM dst;
|
||||
|
||||
DROP TABLE IF EXISTS test.src;
|
||||
DROP TABLE IF EXISTS test.dst;
|
||||
DROP TABLE IF EXISTS src;
|
||||
DROP TABLE IF EXISTS dst;
|
||||
|
@ -1,19 +1,19 @@
|
||||
drop table if exists test.test_in_tuple_1;
|
||||
drop table if exists test.test_in_tuple_2;
|
||||
drop table if exists test.test_in_tuple;
|
||||
drop table if exists test_in_tuple_1;
|
||||
drop table if exists test_in_tuple_2;
|
||||
drop table if exists test_in_tuple;
|
||||
|
||||
create table test.test_in_tuple_1 (key Int32, key_2 Int32, x Array(Int32), y Array(Int32)) engine = MergeTree order by (key, key_2);
|
||||
create table test.test_in_tuple_2 (key Int32, key_2 Int32, x Array(Int32), y Array(Int32)) engine = MergeTree order by (key, key_2);
|
||||
create table test.test_in_tuple as test.test_in_tuple_1 engine = Merge('test', '^test_in_tuple_[0-9]+$');
|
||||
create table test_in_tuple_1 (key Int32, key_2 Int32, x Array(Int32), y Array(Int32)) engine = MergeTree order by (key, key_2);
|
||||
create table test_in_tuple_2 (key Int32, key_2 Int32, x Array(Int32), y Array(Int32)) engine = MergeTree order by (key, key_2);
|
||||
create table test_in_tuple as test_in_tuple_1 engine = Merge(currentDatabase(), '^test_in_tuple_[0-9]+$');
|
||||
|
||||
insert into test.test_in_tuple_1 values (1, 1, [1, 2], [1, 2]);
|
||||
insert into test.test_in_tuple_2 values (2, 1, [1, 2], [1, 2]);
|
||||
select key, arr_x, arr_y, _table from test.test_in_tuple left array join x as arr_x, y as arr_y order by _table;
|
||||
insert into test_in_tuple_1 values (1, 1, [1, 2], [1, 2]);
|
||||
insert into test_in_tuple_2 values (2, 1, [1, 2], [1, 2]);
|
||||
select key, arr_x, arr_y, _table from test_in_tuple left array join x as arr_x, y as arr_y order by _table;
|
||||
select '-';
|
||||
select key, arr_x, arr_y, _table from test.test_in_tuple left array join x as arr_x, y as arr_y where (key_2, arr_x, arr_y) in (1, 1, 1) order by _table;
|
||||
select key, arr_x, arr_y, _table from test_in_tuple left array join x as arr_x, y as arr_y where (key_2, arr_x, arr_y) in (1, 1, 1) order by _table;
|
||||
select '-';
|
||||
select key, arr_x, arr_y, _table from test.test_in_tuple left array join arrayFilter((t, x_0, x_1) -> (key_2, x_0, x_1) in (1, 1, 1), x, x ,y) as arr_x, arrayFilter((t, x_0, x_1) -> (key_2, x_0, x_1) in (1, 1, 1), y, x ,y) as arr_y where (key_2, arr_x, arr_y) in (1, 1, 1) order by _table;
|
||||
select key, arr_x, arr_y, _table from test_in_tuple left array join arrayFilter((t, x_0, x_1) -> (key_2, x_0, x_1) in (1, 1, 1), x, x ,y) as arr_x, arrayFilter((t, x_0, x_1) -> (key_2, x_0, x_1) in (1, 1, 1), y, x ,y) as arr_y where (key_2, arr_x, arr_y) in (1, 1, 1) order by _table;
|
||||
|
||||
drop table if exists test.test_in_tuple_1;
|
||||
drop table if exists test.test_in_tuple_2;
|
||||
drop table if exists test.test_in_tuple;
|
||||
drop table if exists test_in_tuple_1;
|
||||
drop table if exists test_in_tuple_2;
|
||||
drop table if exists test_in_tuple;
|
||||
|
@ -1,8 +1,8 @@
|
||||
DROP TABLE IF EXISTS test.data;
|
||||
CREATE TABLE test.data (s String, x Int8, y Int8) ENGINE = MergeTree ORDER BY tuple();
|
||||
DROP TABLE IF EXISTS data;
|
||||
CREATE TABLE data (s String, x Int8, y Int8) ENGINE = MergeTree ORDER BY tuple();
|
||||
|
||||
INSERT INTO test.data VALUES ('hello', 0, 0), ('world', 0, 0), ('hello', 1, -1), ('world', -1, 1);
|
||||
INSERT INTO data VALUES ('hello', 0, 0), ('world', 0, 0), ('hello', 1, -1), ('world', -1, 1);
|
||||
|
||||
SELECT DISTINCT s FROM remote('127.0.0.{1,2}', test.data) ORDER BY x + y, s;
|
||||
SELECT DISTINCT s FROM remote('127.0.0.{1,2}', currentDatabase(), data) ORDER BY x + y, s;
|
||||
|
||||
DROP TABLE test.data;
|
||||
DROP TABLE data;
|
||||
|
@ -7,7 +7,7 @@ hello
|
||||
hello
|
||||
hello
|
||||
1970-01-01 00:00:01
|
||||
CREATE TABLE test.cast (`x` UInt8, `e` Enum8('hello' = 1, 'world' = 2) DEFAULT CAST(x, 'Enum8(\'hello\' = 1, \'world\' = 2)')) ENGINE = MergeTree ORDER BY e SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.cast (`x` UInt8, `e` Enum8('hello' = 1, 'world' = 2) DEFAULT CAST(x, 'Enum8(\'hello\' = 1, \'world\' = 2)')) ENGINE = MergeTree ORDER BY e SETTINGS index_granularity = 8192
|
||||
x UInt8
|
||||
e Enum8(\'hello\' = 1, \'world\' = 2) DEFAULT CAST(x, \'Enum8(\\\'hello\\\' = 1, \\\'world\\\' = 2)\')
|
||||
1 hello
|
||||
|
@ -5,7 +5,7 @@ SELECT CAST(1, 'Enum8(\'hello\' = 1, \'world\' = 2)');
|
||||
SELECT cast(1, 'Enum8(\'hello\' = 1, \'world\' = 2)');
|
||||
|
||||
SELECT CAST(1 AS Enum8(
|
||||
'hello' = 1,
|
||||
'hello' = 1,
|
||||
'world' = 2));
|
||||
|
||||
SELECT cast(1 AS Enum8(
|
||||
@ -17,8 +17,8 @@ SELECT cast(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
|
||||
|
||||
SELECT toTimeZone(CAST(1 AS TIMESTAMP), 'UTC');
|
||||
|
||||
DROP TABLE IF EXISTS test.cast;
|
||||
CREATE TABLE test.cast
|
||||
DROP TABLE IF EXISTS cast;
|
||||
CREATE TABLE cast
|
||||
(
|
||||
x UInt8,
|
||||
e Enum8
|
||||
@ -39,10 +39,10 @@ CREATE TABLE test.cast
|
||||
)
|
||||
) ENGINE = MergeTree ORDER BY e;
|
||||
|
||||
SHOW CREATE TABLE test.cast FORMAT TSVRaw;
|
||||
DESC TABLE test.cast;
|
||||
SHOW CREATE TABLE cast FORMAT TSVRaw;
|
||||
DESC TABLE cast;
|
||||
|
||||
INSERT INTO test.cast (x) VALUES (1);
|
||||
SELECT * FROM test.cast;
|
||||
INSERT INTO cast (x) VALUES (1);
|
||||
SELECT * FROM cast;
|
||||
|
||||
DROP TABLE test.cast;
|
||||
DROP TABLE cast;
|
||||
|
@ -2,3 +2,4 @@ drop table if exists `table_00653`;
|
||||
create table `table_00653` (val Int32) engine = MergeTree order by val;
|
||||
insert into `table_00653` values (-2), (0), (2);
|
||||
select count() from `table_00653` where toUInt64(val) == 0;
|
||||
drop table table_00653;
|
||||
|
@ -105,3 +105,8 @@ select a1, a2, b1, b2 from tab1 first any left join (select *, a2 as z from tab2
|
||||
select a1, a2, b1, b2 from tab1 first any left join (select *, a2 + 1 as z from tab2) second on first.b1 + 1 = second.z;
|
||||
select tab1.a1, a2, tab1.b1, second.b2 from tab1 first any left join (select * from tab2) second on first.b1 = second.a2;
|
||||
select a1, s.a1 from tab1 any left join (select * from tab1_copy) s on tab1.b1 + 3 = s.b1 + 2 FORMAT JSONEachRow;
|
||||
|
||||
drop table tab1;
|
||||
drop table tab1_copy;
|
||||
drop table tab2;
|
||||
drop table tab3;
|
||||
|
@ -1,9 +1,9 @@
|
||||
DROP TABLE IF EXISTS test.remote_test;
|
||||
CREATE TABLE test.remote_test(a1 UInt8) ENGINE=Memory;
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', test.remote_test) VALUES(1);
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', test.remote_test) VALUES(2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', test.remote_test) VALUES(3);
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', test.remote_test) VALUES(4);
|
||||
SELECT COUNT(*) FROM remote('127.0.0.1', test.remote_test);
|
||||
SELECT count(*) FROM remote('127.0.0.{1,2}', merge(test, '^remote_test'));
|
||||
DROP TABLE test.remote_test;
|
||||
DROP TABLE IF EXISTS remote_test;
|
||||
CREATE TABLE remote_test(a1 UInt8) ENGINE=Memory;
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', currentDatabase(), remote_test) VALUES(1);
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', currentDatabase(), remote_test) VALUES(2);
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', currentDatabase(), remote_test) VALUES(3);
|
||||
INSERT INTO FUNCTION remote('127.0.0.1', currentDatabase(), remote_test) VALUES(4);
|
||||
SELECT COUNT(*) FROM remote('127.0.0.1', currentDatabase(), remote_test);
|
||||
SELECT count(*) FROM remote('127.0.0.{1,2}', merge(currentDatabase(), '^remote_test'));
|
||||
DROP TABLE remote_test;
|
||||
|
@ -1,7 +1,7 @@
|
||||
DROP TABLE IF EXISTS test.remote_test;
|
||||
CREATE TABLE test.remote_test(uid String, its UInt32, action_code String, day Date) ENGINE = MergeTree(day, (uid, its), 8192);
|
||||
INSERT INTO test.remote_test SELECT toString(number) AS uid, number % 3 AS its, toString(number % 3) AS action_code, '2000-01-01' FROM system.numbers LIMIT 10000;
|
||||
SELECT level, COUNT() FROM (SELECT uid, windowFunnel(3600)(toUInt32(its), action_code != '', action_code = '2') AS level FROM remote('127.0.0.{2,3}', test.remote_test) GROUP BY uid) GROUP BY level;
|
||||
SELECT level, COUNT() FROM (SELECT uid, windowFunnel(3600)(toUInt32(its), action_code != '', action_code = '2') AS level FROM remote('127.0.0.{2,3}', test.remote_test) GROUP BY uid) GROUP BY level;
|
||||
SELECT level, COUNT() FROM (SELECT uid, windowFunnel(3600)(toUInt32(its), action_code != '', action_code = '2') AS level FROM remote('127.0.0.{2,3}', test.remote_test) GROUP BY uid) GROUP BY level;
|
||||
DROP TABLE IF EXISTS test.remote_test;
|
||||
DROP TABLE IF EXISTS remote_test;
|
||||
CREATE TABLE remote_test(uid String, its UInt32, action_code String, day Date) ENGINE = MergeTree(day, (uid, its), 8192);
|
||||
INSERT INTO remote_test SELECT toString(number) AS uid, number % 3 AS its, toString(number % 3) AS action_code, '2000-01-01' FROM system.numbers LIMIT 10000;
|
||||
SELECT level, COUNT() FROM (SELECT uid, windowFunnel(3600)(toUInt32(its), action_code != '', action_code = '2') AS level FROM remote('127.0.0.{2,3}', currentDatabase(), remote_test) GROUP BY uid) GROUP BY level;
|
||||
SELECT level, COUNT() FROM (SELECT uid, windowFunnel(3600)(toUInt32(its), action_code != '', action_code = '2') AS level FROM remote('127.0.0.{2,3}', currentDatabase(), remote_test) GROUP BY uid) GROUP BY level;
|
||||
SELECT level, COUNT() FROM (SELECT uid, windowFunnel(3600)(toUInt32(its), action_code != '', action_code = '2') AS level FROM remote('127.0.0.{2,3}', currentDatabase(), remote_test) GROUP BY uid) GROUP BY level;
|
||||
DROP TABLE IF EXISTS remote_test;
|
||||
|
@ -90,6 +90,8 @@ SELECT covarSamp(a, a), covarSamp(b, b), covarSamp(c, c) FROM decimal; -- { serv
|
||||
SELECT corr(a, a), corr(b, b), corr(c, c) FROM decimal; -- { serverError 43 }
|
||||
SELECT 1 LIMIT 0;
|
||||
|
||||
DROP TABLE decimal;
|
||||
|
||||
-- TODO: sumMap
|
||||
-- TODO: other quantile(s)
|
||||
-- TODO: groupArray, groupArrayInsertAt, groupUniqArray
|
||||
|
@ -19,3 +19,5 @@ SELECT a, sum(s), count() from rollup GROUP BY ROLLUP(a) ORDER BY a;
|
||||
SELECT a, sum(s), count() from rollup GROUP BY a WITH ROLLUP ORDER BY a;
|
||||
|
||||
SELECT a, sum(s), count() from rollup GROUP BY a WITH ROLLUP WITH TOTALS ORDER BY a;
|
||||
|
||||
DROP TABLE rollup;
|
||||
|
@ -2,4 +2,4 @@ drop table if exists tab_00712_1;
|
||||
create table tab_00712_1 (a UInt32, b UInt32 alias a + 1, c UInt32) engine = MergeTree order by tuple();
|
||||
insert into tab_00712_1 values (1, 2);
|
||||
select ignore(_part) from tab_00712_1 prewhere b = 2;
|
||||
|
||||
drop table tab_00712_1;
|
||||
|
@ -1,10 +1,10 @@
|
||||
DROP TEMPORARY TABLE IF EXISTS temporary_table;
|
||||
DROP TEMPORARY TABLE IF EXISTS test.test_merge_1;
|
||||
DROP TEMPORARY TABLE IF EXISTS test.test_merge_2;
|
||||
CREATE TABLE test.test_merge_1(id UInt64) ENGINE = Log;
|
||||
CREATE TABLE test.test_merge_2(id UInt64) ENGINE = Log;
|
||||
CREATE TEMPORARY TABLE temporary_table AS SELECT * FROM numbers(1) WHERE number NOT IN (SELECT id FROM merge('test', 'test_merge_1|test_merge_2'));
|
||||
DROP TEMPORARY TABLE IF EXISTS test_merge_1;
|
||||
DROP TEMPORARY TABLE IF EXISTS test_merge_2;
|
||||
CREATE TABLE test_merge_1(id UInt64) ENGINE = Log;
|
||||
CREATE TABLE test_merge_2(id UInt64) ENGINE = Log;
|
||||
CREATE TEMPORARY TABLE temporary_table AS SELECT * FROM numbers(1) WHERE number NOT IN (SELECT id FROM merge(currentDatabase(), 'test_merge_1|test_merge_2'));
|
||||
SELECT * FROM temporary_table;
|
||||
DROP TEMPORARY TABLE IF EXISTS temporary_table;
|
||||
DROP TEMPORARY TABLE IF EXISTS test.test_merge_1;
|
||||
DROP TEMPORARY TABLE IF EXISTS test.test_merge_2;
|
||||
DROP TEMPORARY TABLE IF EXISTS test_merge_1;
|
||||
DROP TEMPORARY TABLE IF EXISTS test_merge_2;
|
||||
|
@ -8,3 +8,6 @@ INSERT INTO default_join1 VALUES(1, 1), (2, 2), (3, 3);
|
||||
INSERT INTO default_join2 VALUES(3, 3), (4, 4);
|
||||
|
||||
SELECT a, b FROM default_join1 JOIN (SELECT a, b FROM default_join2) USING a ORDER BY b SETTINGS join_default_strictness='ANY';
|
||||
|
||||
DROP TABLE default_join1;
|
||||
DROP TABLE default_join2;
|
||||
|
@ -1,88 +1,88 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.test_local_1;
|
||||
DROP TABLE IF EXISTS test.test_local_2;
|
||||
DROP TABLE IF EXISTS test.test_distributed_1;
|
||||
DROP TABLE IF EXISTS test.test_distributed_2;
|
||||
DROP TABLE IF EXISTS test_local_1;
|
||||
DROP TABLE IF EXISTS test_local_2;
|
||||
DROP TABLE IF EXISTS test_distributed_1;
|
||||
DROP TABLE IF EXISTS test_distributed_2;
|
||||
|
||||
CREATE TABLE test.test_local_1 (date Date, value UInt32) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test.test_local_2 (date Date, value UInt32) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test.test_distributed_1 AS test.test_local_1 ENGINE = Distributed('test_shard_localhost', 'test', test_local_1, rand());
|
||||
CREATE TABLE test.test_distributed_2 AS test.test_local_2 ENGINE = Distributed('test_shard_localhost', 'test', test_local_2, rand());
|
||||
CREATE TABLE test_local_1 (date Date, value UInt32) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test_local_2 (date Date, value UInt32) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test_distributed_1 AS test_local_1 ENGINE = Distributed('test_shard_localhost', currentDatabase(), test_local_1, rand());
|
||||
CREATE TABLE test_distributed_2 AS test_local_2 ENGINE = Distributed('test_shard_localhost', currentDatabase(), test_local_2, rand());
|
||||
|
||||
INSERT INTO test.test_local_1 VALUES ('2018-08-01',100);
|
||||
INSERT INTO test.test_local_2 VALUES ('2018-08-01',200);
|
||||
INSERT INTO test_local_1 VALUES ('2018-08-01',100);
|
||||
INSERT INTO test_local_2 VALUES ('2018-08-01',200);
|
||||
|
||||
SELECT '--------------Single Local------------';
|
||||
SELECT * FROM merge('test', 'test_local_1');
|
||||
SELECT *, _table FROM merge('test', 'test_local_1') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge('test', 'test_local_1') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge('test', 'test_local_1') WHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge('test', 'test_local_1') PREWHERE _table = 'test_local_1'; -- { serverError 8 }
|
||||
SELECT * FROM merge('test', 'test_local_1') WHERE _table in ('test_local_1', 'test_local_2');
|
||||
SELECT * FROM merge('test', 'test_local_1') PREWHERE _table in ('test_local_1', 'test_local_2'); -- { serverError 8 }
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1');
|
||||
SELECT *, _table FROM merge(currentDatabase(), 'test_local_1') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge(currentDatabase(), 'test_local_1') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1') WHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1') PREWHERE _table = 'test_local_1'; -- { serverError 8 }
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1') WHERE _table in ('test_local_1', 'test_local_2');
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1') PREWHERE _table in ('test_local_1', 'test_local_2'); -- { serverError 8 }
|
||||
|
||||
SELECT '--------------Single Distributed------------';
|
||||
SELECT * FROM merge('test', 'test_distributed_1');
|
||||
SELECT *, _table FROM merge('test', 'test_distributed_1') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge('test', 'test_distributed_1') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge('test', 'test_distributed_1') WHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge('test', 'test_distributed_1') PREWHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge('test', 'test_distributed_1') WHERE _table in ('test_distributed_1', 'test_distributed_2');
|
||||
SELECT * FROM merge('test', 'test_distributed_1') PREWHERE _table in ('test_distributed_1', 'test_distributed_2');
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1');
|
||||
SELECT *, _table FROM merge(currentDatabase(), 'test_distributed_1') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge(currentDatabase(), 'test_distributed_1') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1') WHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1') PREWHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1') WHERE _table in ('test_distributed_1', 'test_distributed_2');
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1') PREWHERE _table in ('test_distributed_1', 'test_distributed_2');
|
||||
|
||||
SELECT '--------------Local Merge Local------------';
|
||||
SELECT * FROM merge('test', 'test_local_1|test_local_2') ORDER BY _table;
|
||||
SELECT *, _table FROM merge('test', 'test_local_1|test_local_2') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge('test', 'test_local_1|test_local_2') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge('test', 'test_local_1|test_local_2') WHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge('test', 'test_local_1|test_local_2') PREWHERE _table = 'test_local_1'; -- {serverError 8}
|
||||
SELECT * FROM merge('test', 'test_local_1|test_local_2') WHERE _table in ('test_local_1', 'test_local_2') ORDER BY value;
|
||||
SELECT * FROM merge('test', 'test_local_1|test_local_2') PREWHERE _table in ('test_local_1', 'test_local_2') ORDER BY value; -- {serverError 8}
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_local_2') ORDER BY _table;
|
||||
SELECT *, _table FROM merge(currentDatabase(), 'test_local_1|test_local_2') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge(currentDatabase(), 'test_local_1|test_local_2') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_local_2') WHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_local_2') PREWHERE _table = 'test_local_1'; -- {serverError 8}
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_local_2') WHERE _table in ('test_local_1', 'test_local_2') ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_local_2') PREWHERE _table in ('test_local_1', 'test_local_2') ORDER BY value; -- {serverError 8}
|
||||
|
||||
SELECT '--------------Local Merge Distributed------------';
|
||||
SELECT * FROM merge('test', 'test_local_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT *, _table FROM merge('test', 'test_local_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge('test', 'test_local_1|test_distributed_2') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge('test', 'test_local_1|test_distributed_2') WHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge('test', 'test_local_1|test_distributed_2') PREWHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge('test', 'test_local_1|test_distributed_2') WHERE _table in ('test_local_1', 'test_distributed_2') ORDER BY value;
|
||||
SELECT * FROM merge('test', 'test_local_1|test_distributed_2') PREWHERE _table in ('test_local_1', 'test_distributed_2') ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT *, _table FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') WHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') PREWHERE _table = 'test_local_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') WHERE _table in ('test_local_1', 'test_distributed_2') ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_local_1|test_distributed_2') PREWHERE _table in ('test_local_1', 'test_distributed_2') ORDER BY value;
|
||||
|
||||
SELECT '--------------Distributed Merge Distributed------------';
|
||||
SELECT * FROM merge('test', 'test_distributed_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT *, _table FROM merge('test', 'test_distributed_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge('test', 'test_distributed_1|test_distributed_2') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge('test', 'test_distributed_1|test_distributed_2') WHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge('test', 'test_distributed_1|test_distributed_2') PREWHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge('test', 'test_distributed_1|test_distributed_2') WHERE _table in ('test_distributed_1', 'test_distributed_2') ORDER BY value;
|
||||
SELECT * FROM merge('test', 'test_distributed_1|test_distributed_2') PREWHERE _table in ('test_distributed_1', 'test_distributed_2') ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT *, _table FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') ORDER BY _table;
|
||||
SELECT sum(value), _table FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') GROUP BY _table ORDER BY _table;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') WHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') PREWHERE _table = 'test_distributed_1';
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') WHERE _table in ('test_distributed_1', 'test_distributed_2') ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_distributed_1|test_distributed_2') PREWHERE _table in ('test_distributed_1', 'test_distributed_2') ORDER BY value;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_local_1;
|
||||
DROP TABLE IF EXISTS test.test_local_2;
|
||||
DROP TABLE IF EXISTS test.test_distributed_1;
|
||||
DROP TABLE IF EXISTS test.test_distributed_2;
|
||||
DROP TABLE IF EXISTS test_local_1;
|
||||
DROP TABLE IF EXISTS test_local_2;
|
||||
DROP TABLE IF EXISTS test_distributed_1;
|
||||
DROP TABLE IF EXISTS test_distributed_2;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_u64_local;
|
||||
DROP TABLE IF EXISTS test.test_s64_local;
|
||||
DROP TABLE IF EXISTS test.test_u64_distributed;
|
||||
DROP TABLE IF EXISTS test.test_s64_distributed;
|
||||
DROP TABLE IF EXISTS test_u64_local;
|
||||
DROP TABLE IF EXISTS test_s64_local;
|
||||
DROP TABLE IF EXISTS test_u64_distributed;
|
||||
DROP TABLE IF EXISTS test_s64_distributed;
|
||||
|
||||
CREATE TABLE test.test_s64_local (date Date, value Int64) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test.test_u64_local (date Date, value UInt64) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test.test_s64_distributed AS test.test_s64_local ENGINE = Distributed('test_shard_localhost', 'test', test_s64_local, rand());
|
||||
CREATE TABLE test.test_u64_distributed AS test.test_u64_local ENGINE = Distributed('test_shard_localhost', 'test', test_u64_local, rand());
|
||||
CREATE TABLE test_s64_local (date Date, value Int64) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test_u64_local (date Date, value UInt64) ENGINE = MergeTree(date, date, 8192);
|
||||
CREATE TABLE test_s64_distributed AS test_s64_local ENGINE = Distributed('test_shard_localhost', currentDatabase(), test_s64_local, rand());
|
||||
CREATE TABLE test_u64_distributed AS test_u64_local ENGINE = Distributed('test_shard_localhost', currentDatabase(), test_u64_local, rand());
|
||||
|
||||
INSERT INTO test.test_s64_local VALUES ('2018-08-01', -1);
|
||||
INSERT INTO test.test_u64_local VALUES ('2018-08-01', 1);
|
||||
INSERT INTO test_s64_local VALUES ('2018-08-01', -1);
|
||||
INSERT INTO test_u64_local VALUES ('2018-08-01', 1);
|
||||
|
||||
SELECT '--------------Implicit type conversion------------';
|
||||
SELECT * FROM merge('test', 'test_s64_distributed|test_u64_distributed') ORDER BY value;
|
||||
SELECT * FROM merge('test', 'test_s64_distributed|test_u64_distributed') WHERE date = '2018-08-01' ORDER BY value;
|
||||
SELECT * FROM merge('test', 'test_s64_distributed|test_u64_distributed') WHERE _table = 'test_u64_distributed' ORDER BY value;
|
||||
SELECT * FROM merge('test', 'test_s64_distributed|test_u64_distributed') WHERE value = 1; -- { serverError 171}
|
||||
SELECT * FROM merge(currentDatabase(), 'test_s64_distributed|test_u64_distributed') ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_s64_distributed|test_u64_distributed') WHERE date = '2018-08-01' ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_s64_distributed|test_u64_distributed') WHERE _table = 'test_u64_distributed' ORDER BY value;
|
||||
SELECT * FROM merge(currentDatabase(), 'test_s64_distributed|test_u64_distributed') WHERE value = 1; -- { serverError 171}
|
||||
|
||||
DROP TABLE IF EXISTS test.test_u64_local;
|
||||
DROP TABLE IF EXISTS test.test_s64_local;
|
||||
DROP TABLE IF EXISTS test.test_u64_distributed;
|
||||
DROP TABLE IF EXISTS test.test_s64_distributed;
|
||||
DROP TABLE IF EXISTS test_u64_local;
|
||||
DROP TABLE IF EXISTS test_s64_local;
|
||||
DROP TABLE IF EXISTS test_u64_distributed;
|
||||
DROP TABLE IF EXISTS test_s64_distributed;
|
||||
|
@ -17,3 +17,5 @@ SELECT a, b, sum(s), count() from rollup GROUP BY CUBE(a, b) WITH TOTALS ORDER B
|
||||
SELECT a, b, sum(s), count() from rollup GROUP BY a, b WITH CUBE ORDER BY a;
|
||||
|
||||
SELECT a, b, sum(s), count() from rollup GROUP BY a, b WITH CUBE WITH TOTALS ORDER BY a;
|
||||
|
||||
DROP TABLE rollup;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE TABLE test.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COMMENT \'comment 1\', `second_column` UInt8 MATERIALIZED first_column COMMENT \'comment 2\', `third_column` UInt8 ALIAS second_column COMMENT \'comment 3\', `fourth_column` UInt8 COMMENT \'comment 4\', `fifth_column` UInt8) ENGINE = TinyLog
|
||||
CREATE TABLE default.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COMMENT \'comment 1\', `second_column` UInt8 MATERIALIZED first_column COMMENT \'comment 2\', `third_column` UInt8 ALIAS second_column COMMENT \'comment 3\', `fourth_column` UInt8 COMMENT \'comment 4\', `fifth_column` UInt8) ENGINE = TinyLog
|
||||
first_column UInt8 DEFAULT 1 comment 1
|
||||
second_column UInt8 MATERIALIZED first_column comment 2
|
||||
third_column UInt8 ALIAS second_column comment 3
|
||||
@ -11,7 +11,7 @@ fifth_column UInt8
|
||||
│ check_query_comment_column │ fourth_column │ comment 4 │
|
||||
│ check_query_comment_column │ fifth_column │ │
|
||||
└────────────────────────────┴───────────────┴───────────┘
|
||||
CREATE TABLE test.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COMMENT \'comment 1_1\', `second_column` UInt8 MATERIALIZED first_column COMMENT \'comment 2_1\', `third_column` UInt8 ALIAS second_column COMMENT \'comment 3_1\', `fourth_column` UInt8 COMMENT \'comment 4_1\', `fifth_column` UInt8 COMMENT \'comment 5_1\') ENGINE = TinyLog
|
||||
CREATE TABLE default.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COMMENT \'comment 1_1\', `second_column` UInt8 MATERIALIZED first_column COMMENT \'comment 2_1\', `third_column` UInt8 ALIAS second_column COMMENT \'comment 3_1\', `fourth_column` UInt8 COMMENT \'comment 4_1\', `fifth_column` UInt8 COMMENT \'comment 5_1\') ENGINE = TinyLog
|
||||
┌─table──────────────────────┬─name──────────┬─comment─────┐
|
||||
│ check_query_comment_column │ first_column │ comment 1_2 │
|
||||
│ check_query_comment_column │ second_column │ comment 2_2 │
|
||||
@ -19,8 +19,8 @@ CREATE TABLE test.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COM
|
||||
│ check_query_comment_column │ fourth_column │ comment 4_2 │
|
||||
│ check_query_comment_column │ fifth_column │ comment 5_2 │
|
||||
└────────────────────────────┴───────────────┴─────────────┘
|
||||
CREATE TABLE test.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COMMENT \'comment 1_2\', `second_column` UInt8 MATERIALIZED first_column COMMENT \'comment 2_2\', `third_column` UInt8 ALIAS second_column COMMENT \'comment 3_2\', `fourth_column` UInt8 COMMENT \'comment 4_2\', `fifth_column` UInt8 COMMENT \'comment 5_2\') ENGINE = TinyLog
|
||||
CREATE TABLE test.check_query_comment_column (`first_column` UInt8 COMMENT \'comment 1\', `second_column` UInt8 COMMENT \'comment 2\', `third_column` UInt8 COMMENT \'comment 3\') ENGINE = MergeTree() PARTITION BY second_column ORDER BY first_column SAMPLE BY first_column SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.check_query_comment_column (`first_column` UInt8 DEFAULT 1 COMMENT \'comment 1_2\', `second_column` UInt8 MATERIALIZED first_column COMMENT \'comment 2_2\', `third_column` UInt8 ALIAS second_column COMMENT \'comment 3_2\', `fourth_column` UInt8 COMMENT \'comment 4_2\', `fifth_column` UInt8 COMMENT \'comment 5_2\') ENGINE = TinyLog
|
||||
CREATE TABLE default.check_query_comment_column (`first_column` UInt8 COMMENT \'comment 1\', `second_column` UInt8 COMMENT \'comment 2\', `third_column` UInt8 COMMENT \'comment 3\') ENGINE = MergeTree() PARTITION BY second_column ORDER BY first_column SAMPLE BY first_column SETTINGS index_granularity = 8192
|
||||
first_column UInt8 comment 1
|
||||
second_column UInt8 comment 2
|
||||
third_column UInt8 comment 3
|
||||
@ -29,8 +29,8 @@ third_column UInt8 comment 3
|
||||
│ check_query_comment_column │ second_column │ comment 2 │
|
||||
│ check_query_comment_column │ third_column │ comment 3 │
|
||||
└────────────────────────────┴───────────────┴───────────┘
|
||||
CREATE TABLE test.check_query_comment_column (`first_column` UInt8 COMMENT \'comment 1_2\', `second_column` UInt8 COMMENT \'comment 2_2\', `third_column` UInt8 COMMENT \'comment 3_2\') ENGINE = MergeTree() PARTITION BY second_column ORDER BY first_column SAMPLE BY first_column SETTINGS index_granularity = 8192
|
||||
CREATE TABLE test.check_query_comment_column (`first_column` UInt8 COMMENT \'comment 1_3\', `second_column` UInt8 COMMENT \'comment 2_3\', `third_column` UInt8 COMMENT \'comment 3_3\') ENGINE = MergeTree() PARTITION BY second_column ORDER BY first_column SAMPLE BY first_column SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.check_query_comment_column (`first_column` UInt8 COMMENT \'comment 1_2\', `second_column` UInt8 COMMENT \'comment 2_2\', `third_column` UInt8 COMMENT \'comment 3_2\') ENGINE = MergeTree() PARTITION BY second_column ORDER BY first_column SAMPLE BY first_column SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.check_query_comment_column (`first_column` UInt8 COMMENT \'comment 1_3\', `second_column` UInt8 COMMENT \'comment 2_3\', `third_column` UInt8 COMMENT \'comment 3_3\') ENGINE = MergeTree() PARTITION BY second_column ORDER BY first_column SAMPLE BY first_column SETTINGS index_granularity = 8192
|
||||
┌─table──────────────────────┬─name──────────┬─comment─────┐
|
||||
│ check_query_comment_column │ first_column │ comment 1_3 │
|
||||
│ check_query_comment_column │ second_column │ comment 2_3 │
|
||||
|
@ -1,8 +1,7 @@
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.check_query_comment_column;
|
||||
DROP TABLE IF EXISTS check_query_comment_column;
|
||||
|
||||
-- Check COMMENT COLUMN and MODIFY COLUMN statements with simple engine
|
||||
CREATE TABLE test.check_query_comment_column
|
||||
CREATE TABLE check_query_comment_column
|
||||
(
|
||||
first_column UInt8 DEFAULT 1 COMMENT 'comment 1',
|
||||
second_column UInt8 MATERIALIZED first_column COMMENT 'comment 2',
|
||||
@ -11,24 +10,24 @@ CREATE TABLE test.check_query_comment_column
|
||||
fifth_column UInt8
|
||||
) ENGINE = TinyLog;
|
||||
|
||||
SHOW CREATE TABLE test.check_query_comment_column;
|
||||
DESCRIBE TABLE test.check_query_comment_column;
|
||||
SHOW CREATE TABLE check_query_comment_column;
|
||||
DESCRIBE TABLE check_query_comment_column;
|
||||
|
||||
SELECT table, name, comment
|
||||
FROM system.columns
|
||||
WHERE table = 'check_query_comment_column' AND database = 'test'
|
||||
WHERE table = 'check_query_comment_column' AND database = currentDatabase()
|
||||
FORMAT PrettyCompactNoEscapes;
|
||||
|
||||
ALTER TABLE test.check_query_comment_column
|
||||
ALTER TABLE check_query_comment_column
|
||||
COMMENT COLUMN first_column 'comment 1_1',
|
||||
COMMENT COLUMN second_column 'comment 2_1',
|
||||
COMMENT COLUMN third_column 'comment 3_1',
|
||||
COMMENT COLUMN fourth_column 'comment 4_1',
|
||||
COMMENT COLUMN fifth_column 'comment 5_1';
|
||||
|
||||
SHOW CREATE TABLE test.check_query_comment_column;
|
||||
SHOW CREATE TABLE check_query_comment_column;
|
||||
|
||||
ALTER TABLE test.check_query_comment_column
|
||||
ALTER TABLE check_query_comment_column
|
||||
MODIFY COLUMN first_column COMMENT 'comment 1_2',
|
||||
MODIFY COLUMN second_column COMMENT 'comment 2_2',
|
||||
MODIFY COLUMN third_column COMMENT 'comment 3_2',
|
||||
@ -37,14 +36,14 @@ ALTER TABLE test.check_query_comment_column
|
||||
|
||||
SELECT table, name, comment
|
||||
FROM system.columns
|
||||
WHERE table = 'check_query_comment_column' AND database = 'test'
|
||||
WHERE table = 'check_query_comment_column' AND database = currentDatabase()
|
||||
FORMAT PrettyCompactNoEscapes;
|
||||
|
||||
SHOW CREATE TABLE test.check_query_comment_column;
|
||||
DROP TABLE IF EXISTS test.check_query_comment_column;
|
||||
SHOW CREATE TABLE check_query_comment_column;
|
||||
DROP TABLE IF EXISTS check_query_comment_column;
|
||||
|
||||
-- Check `ALTER TABLE table_name COMMENT COLUMN 'comment'` statement with MergeTree engine
|
||||
CREATE TABLE test.check_query_comment_column
|
||||
CREATE TABLE check_query_comment_column
|
||||
(
|
||||
first_column UInt8 COMMENT 'comment 1',
|
||||
second_column UInt8 COMMENT 'comment 2',
|
||||
@ -54,38 +53,38 @@ CREATE TABLE test.check_query_comment_column
|
||||
PARTITION BY second_column
|
||||
SAMPLE BY first_column;
|
||||
|
||||
SHOW CREATE TABLE test.check_query_comment_column;
|
||||
DESCRIBE TABLE test.check_query_comment_column;
|
||||
SHOW CREATE TABLE check_query_comment_column;
|
||||
DESCRIBE TABLE check_query_comment_column;
|
||||
|
||||
SELECT table, name, comment
|
||||
FROM system.columns
|
||||
WHERE table = 'check_query_comment_column' AND database = 'test'
|
||||
WHERE table = 'check_query_comment_column' AND database = currentDatabase()
|
||||
FORMAT PrettyCompactNoEscapes;
|
||||
|
||||
ALTER TABLE test.check_query_comment_column
|
||||
ALTER TABLE check_query_comment_column
|
||||
COMMENT COLUMN first_column 'comment 1_2',
|
||||
COMMENT COLUMN second_column 'comment 2_2',
|
||||
COMMENT COLUMN third_column 'comment 3_2';
|
||||
|
||||
SHOW CREATE TABLE test.check_query_comment_column;
|
||||
SHOW CREATE TABLE check_query_comment_column;
|
||||
|
||||
ALTER TABLE test.check_query_comment_column
|
||||
ALTER TABLE check_query_comment_column
|
||||
MODIFY COLUMN first_column COMMENT 'comment 1_3',
|
||||
MODIFY COLUMN second_column COMMENT 'comment 2_3',
|
||||
MODIFY COLUMN third_column COMMENT 'comment 3_3';
|
||||
|
||||
SHOW CREATE TABLE test.check_query_comment_column;
|
||||
SHOW CREATE TABLE check_query_comment_column;
|
||||
|
||||
ALTER TABLE test.check_query_comment_column
|
||||
ALTER TABLE check_query_comment_column
|
||||
MODIFY COLUMN first_column DEFAULT 1 COMMENT 'comment 1_3',
|
||||
MODIFY COLUMN second_column COMMENT 'comment 2_3', -- We can't change default value of partition key.
|
||||
MODIFY COLUMN third_column DEFAULT 1 COMMENT 'comment 3_3';
|
||||
|
||||
SELECT table, name, comment
|
||||
FROM system.columns
|
||||
WHERE table = 'check_query_comment_column' and database = 'test'
|
||||
WHERE table = 'check_query_comment_column' and database = currentDatabase()
|
||||
FORMAT PrettyCompactNoEscapes;
|
||||
|
||||
DROP TABLE IF EXISTS test.check_query_comment_column;
|
||||
DROP TABLE IF EXISTS check_query_comment_column;
|
||||
|
||||
-- TODO: add here tests with ReplicatedMergeTree
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE TABLE test.ipv4_test (`ipv4_` IPv4) ENGINE = Memory
|
||||
CREATE TABLE default.ipv4_test (`ipv4_` IPv4) ENGINE = Memory
|
||||
0.0.0.0 00
|
||||
8.8.8.8 08080808
|
||||
127.0.0.1 7F000001
|
||||
@ -10,7 +10,7 @@ CREATE TABLE test.ipv4_test (`ipv4_` IPv4) ENGINE = Memory
|
||||
> 127.0.0.1 255.255.255.255
|
||||
= 127.0.0.1 127.0.0.1
|
||||
euqality of IPv4-mapped IPv6 value and IPv4 promoted to IPv6 with function: 1
|
||||
CREATE TABLE test.ipv6_test (`ipv6_` IPv6) ENGINE = Memory
|
||||
CREATE TABLE default.ipv6_test (`ipv6_` IPv6) ENGINE = Memory
|
||||
:: 00000000000000000000000000000000
|
||||
:: 00000000000000000000000000000000
|
||||
::ffff:8.8.8.8 00000000000000000000FFFF08080808
|
||||
|
@ -1,59 +1,59 @@
|
||||
DROP TABLE IF EXISTS test.ipv4_test;
|
||||
DROP TABLE IF EXISTS ipv4_test;
|
||||
|
||||
-- Only valid values for IPv4
|
||||
CREATE TABLE test.ipv4_test (ipv4_ IPv4) ENGINE = Memory;
|
||||
CREATE TABLE ipv4_test (ipv4_ IPv4) ENGINE = Memory;
|
||||
|
||||
-- ipv4_ column shoud have type 'IPv4'
|
||||
SHOW CREATE TABLE test.ipv4_test;
|
||||
SHOW CREATE TABLE ipv4_test;
|
||||
|
||||
INSERT INTO test.ipv4_test (ipv4_) VALUES ('0.0.0.0'), ('255.255.255.255'), ('192.168.0.91'), ('127.0.0.1'), ('8.8.8.8');
|
||||
INSERT INTO ipv4_test (ipv4_) VALUES ('0.0.0.0'), ('255.255.255.255'), ('192.168.0.91'), ('127.0.0.1'), ('8.8.8.8');
|
||||
|
||||
SELECT ipv4_, hex(ipv4_) FROM test.ipv4_test ORDER BY ipv4_;
|
||||
SELECT ipv4_, hex(ipv4_) FROM ipv4_test ORDER BY ipv4_;
|
||||
|
||||
SELECT '< 127.0.0.1', ipv4_ FROM test.ipv4_test
|
||||
SELECT '< 127.0.0.1', ipv4_ FROM ipv4_test
|
||||
WHERE ipv4_ < toIPv4('127.0.0.1')
|
||||
ORDER BY ipv4_;
|
||||
|
||||
SELECT '> 127.0.0.1', ipv4_ FROM test.ipv4_test
|
||||
SELECT '> 127.0.0.1', ipv4_ FROM ipv4_test
|
||||
WHERE ipv4_ > toIPv4('127.0.0.1')
|
||||
ORDER BY ipv4_;
|
||||
|
||||
SELECT '= 127.0.0.1', ipv4_ FROM test.ipv4_test
|
||||
SELECT '= 127.0.0.1', ipv4_ FROM ipv4_test
|
||||
WHERE ipv4_ = toIPv4('127.0.0.1')
|
||||
ORDER BY ipv4_;
|
||||
|
||||
-- TODO: Assert that invalid values can't be inserted into IPv4 column.
|
||||
|
||||
DROP TABLE IF EXISTS test.ipv4_test;
|
||||
DROP TABLE IF EXISTS ipv4_test;
|
||||
|
||||
|
||||
select 'euqality of IPv4-mapped IPv6 value and IPv4 promoted to IPv6 with function:', toIPv6('::ffff:127.0.0.1') = IPv4ToIPv6(toIPv4('127.0.0.1'));
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS test.ipv6_test;
|
||||
DROP TABLE IF EXISTS ipv6_test;
|
||||
|
||||
-- Only valid values for IPv6
|
||||
CREATE TABLE test.ipv6_test (ipv6_ IPv6) ENGINE = Memory;
|
||||
CREATE TABLE ipv6_test (ipv6_ IPv6) ENGINE = Memory;
|
||||
|
||||
-- ipv6_ column shoud have type 'IPv6'
|
||||
SHOW CREATE TABLE test.ipv6_test;
|
||||
SHOW CREATE TABLE ipv6_test;
|
||||
|
||||
INSERT INTO test.ipv6_test VALUES ('::'), ('0:0:0:0:0:0:0:0'), ('FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF'), ('2001:0DB8:AC10:FE01:FEED:BABE:CAFE:F00D'), ('0000:0000:0000:0000:0000:FFFF:C1FC:110A'), ('::ffff:127.0.0.1'), ('::ffff:8.8.8.8');
|
||||
INSERT INTO ipv6_test VALUES ('::'), ('0:0:0:0:0:0:0:0'), ('FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF'), ('2001:0DB8:AC10:FE01:FEED:BABE:CAFE:F00D'), ('0000:0000:0000:0000:0000:FFFF:C1FC:110A'), ('::ffff:127.0.0.1'), ('::ffff:8.8.8.8');
|
||||
|
||||
SELECT ipv6_, hex(ipv6_) FROM test.ipv6_test ORDER BY ipv6_;
|
||||
SELECT ipv6_, hex(ipv6_) FROM ipv6_test ORDER BY ipv6_;
|
||||
|
||||
SELECT '< 127.0.0.1', ipv6_ FROM test.ipv6_test
|
||||
SELECT '< 127.0.0.1', ipv6_ FROM ipv6_test
|
||||
WHERE ipv6_ < IPv4ToIPv6(toIPv4('127.0.0.1'))
|
||||
ORDER BY ipv6_;
|
||||
|
||||
SELECT '> 127.0.0.1', ipv6_ FROM test.ipv6_test
|
||||
SELECT '> 127.0.0.1', ipv6_ FROM ipv6_test
|
||||
WHERE ipv6_ > IPv4ToIPv6(toIPv4('127.0.0.1'))
|
||||
ORDER BY ipv6_;
|
||||
|
||||
SELECT '= 127.0.0.1', ipv6_ FROM test.ipv6_test
|
||||
SELECT '= 127.0.0.1', ipv6_ FROM ipv6_test
|
||||
WHERE ipv6_ = IPv4ToIPv6(toIPv4('127.0.0.1'))
|
||||
ORDER BY ipv6_;
|
||||
|
||||
-- TODO: Assert that invalid values can't be inserted into IPv6 column.
|
||||
|
||||
DROP TABLE IF EXISTS test.ipv6_test;
|
||||
DROP TABLE IF EXISTS ipv6_test;
|
||||
|
@ -1,23 +1,23 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
||||
DROP TABLE IF EXISTS quorum1;
|
||||
DROP TABLE IF EXISTS quorum2;
|
||||
|
||||
CREATE TABLE test.quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE test.quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
|
||||
|
||||
SET insert_quorum=2;
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
INSERT INTO test.quorum1 VALUES (1, '2018-11-15');
|
||||
INSERT INTO test.quorum1 VALUES (2, '2018-11-15');
|
||||
INSERT INTO quorum1 VALUES (1, '2018-11-15');
|
||||
INSERT INTO quorum1 VALUES (2, '2018-11-15');
|
||||
|
||||
SELECT x FROM test.quorum1 ORDER BY x;
|
||||
SELECT x FROM test.quorum2 ORDER BY x;
|
||||
SELECT x FROM quorum1 ORDER BY x;
|
||||
SELECT x FROM quorum2 ORDER BY x;
|
||||
|
||||
OPTIMIZE TABLE test.quorum1 PARTITION '2018-11-15' FINAL;
|
||||
OPTIMIZE TABLE quorum1 PARTITION '2018-11-15' FINAL;
|
||||
|
||||
SELECT count(*) FROM system.parts WHERE active AND database = 'test' AND table='quorum1';
|
||||
SELECT count(*) FROM system.parts WHERE active AND database = currentDatabase() AND table='quorum1';
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
||||
DROP TABLE IF EXISTS quorum1;
|
||||
DROP TABLE IF EXISTS quorum2;
|
||||
|
@ -4,3 +4,4 @@ CREATE TABLE or_expr_bug (a UInt64, b UInt64) ENGINE = Memory;
|
||||
INSERT INTO or_expr_bug VALUES(1,21),(1,22),(1,23),(2,21),(2,22),(2,23),(3,21),(3,22),(3,23);
|
||||
|
||||
SELECT count(*) FROM or_expr_bug WHERE (a=1 OR a=2 OR a=3) AND (b=21 OR b=22 OR b=23);
|
||||
DROP TABLE or_expr_bug;
|
||||
|
@ -1 +1,2 @@
|
||||
CREATE DATABASE IF NOT EXISTS test; -- foo
|
||||
CREATE DATABASE IF NOT EXISTS test_00741; -- foo
|
||||
DROP DATABASE test_00741;
|
||||
|
@ -1,32 +1,32 @@
|
||||
DROP TABLE IF EXISTS test.dst_00753;
|
||||
DROP TABLE IF EXISTS test.buffer_00753;
|
||||
DROP TABLE IF EXISTS dst_00753;
|
||||
DROP TABLE IF EXISTS buffer_00753;
|
||||
SET send_logs_level = 'error';
|
||||
|
||||
CREATE TABLE test.dst_00753 (x UInt64, y UInt64) ENGINE = MergeTree ORDER BY tuple();
|
||||
CREATE TABLE test.buffer_00753 (x UInt64, y UInt64) ENGINE = Buffer(test, dst_00753, 1, 99999, 99999, 1, 1, 99999, 99999);
|
||||
CREATE TABLE dst_00753 (x UInt64, y UInt64) ENGINE = MergeTree ORDER BY tuple();
|
||||
CREATE TABLE buffer_00753 (x UInt64, y UInt64) ENGINE = Buffer(currentDatabase(), dst_00753, 1, 99999, 99999, 1, 1, 99999, 99999);
|
||||
|
||||
INSERT INTO test.buffer_00753 VALUES (1, 100);
|
||||
INSERT INTO test.buffer_00753 VALUES (2, 200);
|
||||
INSERT INTO test.buffer_00753 VALUES (3, 300);
|
||||
INSERT INTO buffer_00753 VALUES (1, 100);
|
||||
INSERT INTO buffer_00753 VALUES (2, 200);
|
||||
INSERT INTO buffer_00753 VALUES (3, 300);
|
||||
SELECT 'init';
|
||||
SELECT * FROM test.dst_00753 ORDER BY x;
|
||||
SELECT * FROM dst_00753 ORDER BY x;
|
||||
SELECT '-';
|
||||
SELECT * FROM test.buffer_00753 ORDER BY x;
|
||||
SELECT * FROM buffer_00753 ORDER BY x;
|
||||
|
||||
ALTER TABLE test.dst_00753 DROP COLUMN x, MODIFY COLUMN y String, ADD COLUMN z String DEFAULT 'DEFZ';
|
||||
ALTER TABLE dst_00753 DROP COLUMN x, MODIFY COLUMN y String, ADD COLUMN z String DEFAULT 'DEFZ';
|
||||
|
||||
INSERT INTO test.buffer_00753 VALUES (4, 400);
|
||||
INSERT INTO buffer_00753 VALUES (4, 400);
|
||||
SELECT 'alt';
|
||||
SELECT * FROM test.dst_00753 ORDER BY y;
|
||||
SELECT * FROM dst_00753 ORDER BY y;
|
||||
SELECT '-';
|
||||
SELECT * FROM test.buffer_00753 ORDER BY y;
|
||||
SELECT * FROM buffer_00753 ORDER BY y;
|
||||
|
||||
OPTIMIZE TABLE test.buffer_00753;
|
||||
OPTIMIZE TABLE buffer_00753;
|
||||
SELECT 'opt';
|
||||
SELECT * FROM test.dst_00753 ORDER BY y;
|
||||
SELECT * FROM dst_00753 ORDER BY y;
|
||||
SELECT '-';
|
||||
SELECT * FROM test.buffer_00753 ORDER BY y;
|
||||
SELECT * FROM buffer_00753 ORDER BY y;
|
||||
|
||||
SET send_logs_level = 'warning';
|
||||
DROP TABLE IF EXISTS test.dst_00753;
|
||||
DROP TABLE IF EXISTS test.buffer_00753;
|
||||
DROP TABLE IF EXISTS dst_00753;
|
||||
DROP TABLE IF EXISTS buffer_00753;
|
||||
|
@ -1,5 +1,5 @@
|
||||
*** Check SHOW CREATE TABLE ***
|
||||
CREATE TABLE test.alter_column (`x` UInt32, `y` Int32) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.alter_column (`x` UInt32, `y` Int32) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192
|
||||
*** Check parts ***
|
||||
0 0
|
||||
10 -10
|
||||
@ -52,7 +52,7 @@ CREATE TABLE test.alter_column (`x` UInt32, `y` Int32) ENGINE = MergeTree PARTIT
|
||||
8 -8
|
||||
9 -9
|
||||
*** Check SHOW CREATE TABLE after ALTER MODIFY ***
|
||||
CREATE TABLE test.alter_column (`x` UInt32, `y` Int64) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.alter_column (`x` UInt32, `y` Int64) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192
|
||||
*** Check parts after ALTER MODIFY ***
|
||||
0 0
|
||||
10 -10
|
||||
|
@ -2,23 +2,23 @@
|
||||
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.alter_column;
|
||||
DROP TABLE IF EXISTS alter_column;
|
||||
|
||||
CREATE TABLE test.alter_column(x UInt32, y Int32) ENGINE MergeTree PARTITION BY x ORDER BY x;
|
||||
INSERT INTO test.alter_column (x, y) SELECT number AS x, -number AS y FROM system.numbers LIMIT 50;
|
||||
CREATE TABLE alter_column(x UInt32, y Int32) ENGINE MergeTree PARTITION BY x ORDER BY x;
|
||||
INSERT INTO alter_column (x, y) SELECT number AS x, -number AS y FROM system.numbers LIMIT 50;
|
||||
|
||||
SELECT '*** Check SHOW CREATE TABLE ***';
|
||||
SHOW CREATE TABLE test.alter_column;
|
||||
SHOW CREATE TABLE alter_column;
|
||||
|
||||
SELECT '*** Check parts ***';
|
||||
SELECT * FROM test.alter_column ORDER BY _part;
|
||||
SELECT * FROM alter_column ORDER BY _part;
|
||||
|
||||
ALTER TABLE test.alter_column MODIFY COLUMN y Int64;
|
||||
ALTER TABLE alter_column MODIFY COLUMN y Int64;
|
||||
|
||||
SELECT '*** Check SHOW CREATE TABLE after ALTER MODIFY ***';
|
||||
SHOW CREATE TABLE test.alter_column;
|
||||
SHOW CREATE TABLE alter_column;
|
||||
|
||||
SELECT '*** Check parts after ALTER MODIFY ***';
|
||||
SELECT * FROM test.alter_column ORDER BY _part;
|
||||
SELECT * FROM alter_column ORDER BY _part;
|
||||
|
||||
DROP TABLE test.alter_column;
|
||||
DROP TABLE alter_column;
|
||||
|
@ -9,4 +9,4 @@
|
||||
1 2 1 30
|
||||
1 2 4 90
|
||||
*** Check SHOW CREATE TABLE ***
|
||||
CREATE TABLE test.summing (`x` UInt32, `y` UInt32, `z` UInt32, `val` UInt32) ENGINE = SummingMergeTree PRIMARY KEY (x, y) ORDER BY (x, y, -z) SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.summing (`x` UInt32, `y` UInt32, `z` UInt32, `val` UInt32) ENGINE = SummingMergeTree PRIMARY KEY (x, y) ORDER BY (x, y, -z) SETTINGS index_granularity = 8192
|
||||
|
@ -1,38 +1,38 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.old_style;
|
||||
CREATE TABLE test.old_style(d Date, x UInt32) ENGINE MergeTree(d, x, 8192);
|
||||
ALTER TABLE test.old_style ADD COLUMN y UInt32, MODIFY ORDER BY (x, y); -- { serverError 36}
|
||||
DROP TABLE test.old_style;
|
||||
DROP TABLE IF EXISTS old_style;
|
||||
CREATE TABLE old_style(d Date, x UInt32) ENGINE MergeTree(d, x, 8192);
|
||||
ALTER TABLE old_style ADD COLUMN y UInt32, MODIFY ORDER BY (x, y); -- { serverError 36}
|
||||
DROP TABLE old_style;
|
||||
|
||||
DROP TABLE IF EXISTS test.summing;
|
||||
CREATE TABLE test.summing(x UInt32, y UInt32, val UInt32) ENGINE SummingMergeTree ORDER BY (x, y);
|
||||
DROP TABLE IF EXISTS summing;
|
||||
CREATE TABLE summing(x UInt32, y UInt32, val UInt32) ENGINE SummingMergeTree ORDER BY (x, y);
|
||||
|
||||
/* Can't add an expression with existing column to ORDER BY. */
|
||||
ALTER TABLE test.summing MODIFY ORDER BY (x, y, -val); -- { serverError 36}
|
||||
ALTER TABLE summing MODIFY ORDER BY (x, y, -val); -- { serverError 36}
|
||||
|
||||
/* Can't add an expression with existing column to ORDER BY. */
|
||||
ALTER TABLE test.summing ADD COLUMN z UInt32 DEFAULT x + 1, MODIFY ORDER BY (x, y, -z); -- { serverError 36}
|
||||
ALTER TABLE summing ADD COLUMN z UInt32 DEFAULT x + 1, MODIFY ORDER BY (x, y, -z); -- { serverError 36}
|
||||
|
||||
/* Can't add nonexistent column to ORDER BY. */
|
||||
ALTER TABLE test.summing MODIFY ORDER BY (x, y, nonexistent); -- { serverError 47}
|
||||
ALTER TABLE summing MODIFY ORDER BY (x, y, nonexistent); -- { serverError 47}
|
||||
|
||||
/* Can't modyfy ORDER BY so that it is no longer a prefix of the PRIMARY KEY. */
|
||||
ALTER TABLE test.summing MODIFY ORDER BY x; -- { serverError 36}
|
||||
ALTER TABLE summing MODIFY ORDER BY x; -- { serverError 36}
|
||||
|
||||
INSERT INTO test.summing(x, y, val) VALUES (1, 2, 10), (1, 2, 20);
|
||||
INSERT INTO summing(x, y, val) VALUES (1, 2, 10), (1, 2, 20);
|
||||
|
||||
ALTER TABLE test.summing ADD COLUMN z UInt32 AFTER y, MODIFY ORDER BY (x, y, -z);
|
||||
ALTER TABLE summing ADD COLUMN z UInt32 AFTER y, MODIFY ORDER BY (x, y, -z);
|
||||
|
||||
INSERT INTO test.summing(x, y, z, val) values (1, 2, 1, 30), (1, 2, 2, 40), (1, 2, 2, 50);
|
||||
INSERT INTO summing(x, y, z, val) values (1, 2, 1, 30), (1, 2, 2, 40), (1, 2, 2, 50);
|
||||
|
||||
SELECT '*** Check that the parts are sorted according to the new key. ***';
|
||||
SELECT * FROM test.summing ORDER BY _part;
|
||||
SELECT * FROM summing ORDER BY _part;
|
||||
|
||||
SELECT '*** Check that the rows are collapsed according to the new key. ***';
|
||||
SELECT * FROM test.summing FINAL ORDER BY x, y, z;
|
||||
SELECT * FROM summing FINAL ORDER BY x, y, z;
|
||||
|
||||
SELECT '*** Check SHOW CREATE TABLE ***';
|
||||
SHOW CREATE TABLE test.summing;
|
||||
SHOW CREATE TABLE summing;
|
||||
|
||||
DROP TABLE test.summing;
|
||||
DROP TABLE summing;
|
||||
|
@ -1,8 +1,7 @@
|
||||
drop table if exists test.t;
|
||||
drop table if exists test.td;
|
||||
create table test.t (val UInt32) engine = MergeTree order by val;
|
||||
create table test.td engine = Distributed(test_shard_localhost, 'test', 't') as test.t;
|
||||
select engine from system.tables where database = 'test' and name = 'td';
|
||||
drop table if exists test.t;
|
||||
drop table if exists test.td;
|
||||
|
||||
drop table if exists t;
|
||||
drop table if exists td;
|
||||
create table t (val UInt32) engine = MergeTree order by val;
|
||||
create table td engine = Distributed(test_shard_localhost, currentDatabase(), 't') as t;
|
||||
select engine from system.tables where database = currentDatabase() and name = 'td';
|
||||
drop table if exists t;
|
||||
drop table if exists td;
|
||||
|
@ -29,3 +29,6 @@ from (
|
||||
where dt = '2019-01-14' and id = 1
|
||||
)
|
||||
group by dt, id;
|
||||
|
||||
DROP TABLE table1;
|
||||
DROP TABLE table2;
|
||||
|
@ -1,11 +1,11 @@
|
||||
DROP TABLE IF EXISTS test.low_cardinality;
|
||||
DROP TABLE IF EXISTS test.low_cardinality_all;
|
||||
DROP TABLE IF EXISTS low_cardinality;
|
||||
DROP TABLE IF EXISTS low_cardinality_all;
|
||||
|
||||
CREATE TABLE test.low_cardinality (d Date, x UInt32, s LowCardinality(String)) ENGINE = MergeTree(d, x, 8192);
|
||||
CREATE TABLE test.low_cardinality_all (d Date, x UInt32, s LowCardinality(String)) ENGINE = Distributed(test_shard_localhost, test, low_cardinality, sipHash64(s));
|
||||
CREATE TABLE low_cardinality (d Date, x UInt32, s LowCardinality(String)) ENGINE = MergeTree(d, x, 8192);
|
||||
CREATE TABLE low_cardinality_all (d Date, x UInt32, s LowCardinality(String)) ENGINE = Distributed(test_shard_localhost, currentDatabase(), low_cardinality, sipHash64(s));
|
||||
|
||||
INSERT INTO test.low_cardinality_all (d,x,s) VALUES ('2018-11-12',1,'123');
|
||||
SELECT s FROM test.low_cardinality_all;
|
||||
INSERT INTO low_cardinality_all (d,x,s) VALUES ('2018-11-12',1,'123');
|
||||
SELECT s FROM low_cardinality_all;
|
||||
|
||||
DROP TABLE IF EXISTS test.low_cardinality;
|
||||
DROP TABLE IF EXISTS test.low_cardinality_all;
|
||||
DROP TABLE IF EXISTS low_cardinality;
|
||||
DROP TABLE IF EXISTS low_cardinality_all;
|
||||
|
@ -1,8 +1,7 @@
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.datetime_table;
|
||||
DROP TABLE IF EXISTS datetime_table;
|
||||
|
||||
-- Create a table with DateTime column, but not used in partition key
|
||||
CREATE TABLE test.datetime_table
|
||||
CREATE TABLE datetime_table
|
||||
(
|
||||
t DateTime,
|
||||
name String,
|
||||
@ -11,23 +10,23 @@ CREATE TABLE test.datetime_table
|
||||
ORDER BY (t, name)
|
||||
PARTITION BY value;
|
||||
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2);
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-02 00:00:00'),'name2',2);
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-03 00:00:00'),'name1',4);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 00:00:00'),'name2',2);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-03 00:00:00'),'name1',4);
|
||||
|
||||
-- min_time and max_time are not filled
|
||||
-- min_time and max_time are not filled
|
||||
|
||||
SELECT partition, MIN(min_time) as min_time, MAX(max_time) as max_time
|
||||
FROM system.parts
|
||||
WHERE database = 'test' and table = 'datetime_table' AND active = 1
|
||||
FROM system.parts
|
||||
WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1
|
||||
GROUP BY partition
|
||||
ORDER BY partition ASC
|
||||
FORMAT CSV;
|
||||
|
||||
DROP TABLE IF EXISTS test.datetime_table;
|
||||
DROP TABLE IF EXISTS datetime_table;
|
||||
|
||||
-- Create a table with DateTime column, this time used in partition key
|
||||
CREATE TABLE test.datetime_table
|
||||
CREATE TABLE datetime_table
|
||||
(
|
||||
t DateTime,
|
||||
name String,
|
||||
@ -35,26 +34,26 @@ CREATE TABLE test.datetime_table
|
||||
) ENGINE = MergeTree()
|
||||
ORDER BY (t, name)
|
||||
PARTITION BY toStartOfDay(t);
|
||||
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2);
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-01 02:00:00'),'name1',3);
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-02 01:00:00'),'name2',2);
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-02 23:00:00'),'name2',5);
|
||||
INSERT INTO test.datetime_table VALUES (toDateTime('2016-01-03 04:00:00'),'name1',4);
|
||||
|
||||
-- min_time and max_time are now filled
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 02:00:00'),'name1',3);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 01:00:00'),'name2',2);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 23:00:00'),'name2',5);
|
||||
INSERT INTO datetime_table VALUES (toDateTime('2016-01-03 04:00:00'),'name1',4);
|
||||
|
||||
-- min_time and max_time are now filled
|
||||
|
||||
SELECT partition, MIN(min_time) as min_time, MAX(max_time) as max_time
|
||||
FROM system.parts
|
||||
WHERE database = 'test' and table = 'datetime_table' AND active = 1
|
||||
FROM system.parts
|
||||
WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1
|
||||
GROUP BY partition
|
||||
ORDER BY partition ASC
|
||||
FORMAT CSV;
|
||||
|
||||
DROP TABLE IF EXISTS test.datetime_table;
|
||||
DROP TABLE IF EXISTS datetime_table;
|
||||
|
||||
-- Create a table with DateTime column, this time used in partition key, but not at the first level
|
||||
CREATE TABLE test.datetime_table
|
||||
CREATE TABLE datetime_table
|
||||
(
|
||||
t DateTime,
|
||||
name String,
|
||||
@ -65,19 +64,19 @@ CREATE TABLE test.datetime_table
|
||||
|
||||
-- We are using a daily aggregation that is independant of the timezone, add data also
|
||||
|
||||
INSERT INTO test.datetime_table VALUES (1451606400,'name1',2);
|
||||
INSERT INTO test.datetime_table VALUES (1451613600,'name1',3);
|
||||
INSERT INTO test.datetime_table VALUES (1451696400,'name2',2);
|
||||
INSERT INTO test.datetime_table VALUES (1451775600,'name2',5);
|
||||
INSERT INTO test.datetime_table VALUES (1451793600,'name1',4);
|
||||
INSERT INTO datetime_table VALUES (1451606400,'name1',2);
|
||||
INSERT INTO datetime_table VALUES (1451613600,'name1',3);
|
||||
INSERT INTO datetime_table VALUES (1451696400,'name2',2);
|
||||
INSERT INTO datetime_table VALUES (1451775600,'name2',5);
|
||||
INSERT INTO datetime_table VALUES (1451793600,'name1',4);
|
||||
|
||||
-- min_time and max_time are now filled
|
||||
|
||||
SELECT partition, toUnixTimestamp(MIN(min_time)) as min_unix_time, toUnixTimestamp(MAX(max_time)) as max_unix_time
|
||||
FROM system.parts
|
||||
WHERE database = 'test' and table = 'datetime_table' AND active = 1
|
||||
WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1
|
||||
GROUP BY partition
|
||||
ORDER BY partition ASC
|
||||
FORMAT CSV;
|
||||
|
||||
DROP TABLE IF EXISTS test.datetime_table;
|
||||
DROP TABLE IF EXISTS datetime_table;
|
||||
|
@ -1,88 +1,88 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.alter_compression_codec;
|
||||
DROP TABLE IF EXISTS alter_compression_codec;
|
||||
|
||||
CREATE TABLE test.alter_compression_codec (
|
||||
CREATE TABLE alter_compression_codec (
|
||||
somedate Date CODEC(LZ4),
|
||||
id UInt64 CODEC(NONE)
|
||||
) ENGINE = MergeTree() PARTITION BY somedate ORDER BY id;
|
||||
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 1);
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 2);
|
||||
SELECT * FROM test.alter_compression_codec ORDER BY id;
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 1);
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 2);
|
||||
SELECT * FROM alter_compression_codec ORDER BY id;
|
||||
|
||||
ALTER TABLE test.alter_compression_codec ADD COLUMN alter_column String DEFAULT 'default_value' CODEC(ZSTD);
|
||||
SELECT compression_codec FROM system.columns WHERE database = 'test' AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
ALTER TABLE alter_compression_codec ADD COLUMN alter_column String DEFAULT 'default_value' CODEC(ZSTD);
|
||||
SELECT compression_codec FROM system.columns WHERE database = currentDatabase() AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 3, '3');
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 4, '4');
|
||||
SELECT * FROM test.alter_compression_codec ORDER BY id;
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 3, '3');
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 4, '4');
|
||||
SELECT * FROM alter_compression_codec ORDER BY id;
|
||||
|
||||
ALTER TABLE test.alter_compression_codec MODIFY COLUMN alter_column CODEC(NONE);
|
||||
SELECT compression_codec FROM system.columns WHERE database = 'test' AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
ALTER TABLE alter_compression_codec MODIFY COLUMN alter_column CODEC(NONE);
|
||||
SELECT compression_codec FROM system.columns WHERE database = currentDatabase() AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 5, '5');
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 6, '6');
|
||||
SELECT * FROM test.alter_compression_codec ORDER BY id;
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 5, '5');
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 6, '6');
|
||||
SELECT * FROM alter_compression_codec ORDER BY id;
|
||||
|
||||
OPTIMIZE TABLE test.alter_compression_codec FINAL;
|
||||
SELECT * FROM test.alter_compression_codec ORDER BY id;
|
||||
OPTIMIZE TABLE alter_compression_codec FINAL;
|
||||
SELECT * FROM alter_compression_codec ORDER BY id;
|
||||
|
||||
ALTER TABLE test.alter_compression_codec MODIFY COLUMN alter_column CODEC(ZSTD, LZ4HC, LZ4, LZ4, NONE);
|
||||
SELECT compression_codec FROM system.columns WHERE database = 'test' AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
ALTER TABLE alter_compression_codec MODIFY COLUMN alter_column CODEC(ZSTD, LZ4HC, LZ4, LZ4, NONE);
|
||||
SELECT compression_codec FROM system.columns WHERE database = currentDatabase() AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 7, '7');
|
||||
INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 8, '8');
|
||||
OPTIMIZE TABLE test.alter_compression_codec FINAL;
|
||||
SELECT * FROM test.alter_compression_codec ORDER BY id;
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 7, '7');
|
||||
INSERT INTO alter_compression_codec VALUES('2018-01-01', 8, '8');
|
||||
OPTIMIZE TABLE alter_compression_codec FINAL;
|
||||
SELECT * FROM alter_compression_codec ORDER BY id;
|
||||
|
||||
ALTER TABLE test.alter_compression_codec MODIFY COLUMN alter_column FixedString(100);
|
||||
SELECT compression_codec FROM system.columns WHERE database = 'test' AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
ALTER TABLE alter_compression_codec MODIFY COLUMN alter_column FixedString(100);
|
||||
SELECT compression_codec FROM system.columns WHERE database = currentDatabase() AND table = 'alter_compression_codec' AND name = 'alter_column';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS test.alter_compression_codec;
|
||||
DROP TABLE IF EXISTS alter_compression_codec;
|
||||
|
||||
DROP TABLE IF EXISTS test.alter_bad_codec;
|
||||
DROP TABLE IF EXISTS alter_bad_codec;
|
||||
|
||||
CREATE TABLE test.alter_bad_codec (
|
||||
CREATE TABLE alter_bad_codec (
|
||||
somedate Date CODEC(LZ4),
|
||||
id UInt64 CODEC(NONE)
|
||||
) ENGINE = MergeTree() ORDER BY tuple();
|
||||
|
||||
ALTER TABLE test.alter_bad_codec ADD COLUMN alter_column DateTime DEFAULT '2019-01-01 00:00:00' CODEC(gbdgkjsdh); -- { serverError 432 }
|
||||
ALTER TABLE alter_bad_codec ADD COLUMN alter_column DateTime DEFAULT '2019-01-01 00:00:00' CODEC(gbdgkjsdh); -- { serverError 432 }
|
||||
|
||||
ALTER TABLE test.alter_bad_codec ADD COLUMN alter_column DateTime DEFAULT '2019-01-01 00:00:00' CODEC(ZSTD(100)); -- { serverError 433 }
|
||||
ALTER TABLE alter_bad_codec ADD COLUMN alter_column DateTime DEFAULT '2019-01-01 00:00:00' CODEC(ZSTD(100)); -- { serverError 433 }
|
||||
|
||||
DROP TABLE IF EXISTS test.alter_bad_codec;
|
||||
DROP TABLE IF EXISTS alter_bad_codec;
|
||||
|
||||
DROP TABLE IF EXISTS test.large_alter_table_00804;
|
||||
DROP TABLE IF EXISTS test.store_of_hash_00804;
|
||||
DROP TABLE IF EXISTS large_alter_table_00804;
|
||||
DROP TABLE IF EXISTS store_of_hash_00804;
|
||||
|
||||
CREATE TABLE test.large_alter_table_00804 (
|
||||
CREATE TABLE large_alter_table_00804 (
|
||||
somedate Date CODEC(ZSTD, ZSTD, ZSTD(12), LZ4HC(12)),
|
||||
id UInt64 CODEC(LZ4, ZSTD, NONE, LZ4HC),
|
||||
data String CODEC(ZSTD(2), LZ4HC, NONE, LZ4, LZ4)
|
||||
) ENGINE = MergeTree() PARTITION BY somedate ORDER BY id SETTINGS index_granularity = 2;
|
||||
|
||||
INSERT INTO test.large_alter_table_00804 SELECT toDate('2019-01-01'), number, toString(number + rand()) FROM system.numbers LIMIT 300000;
|
||||
INSERT INTO large_alter_table_00804 SELECT toDate('2019-01-01'), number, toString(number + rand()) FROM system.numbers LIMIT 300000;
|
||||
|
||||
CREATE TABLE test.store_of_hash_00804 (hash UInt64) ENGINE = Memory();
|
||||
CREATE TABLE store_of_hash_00804 (hash UInt64) ENGINE = Memory();
|
||||
|
||||
INSERT INTO test.store_of_hash_00804 SELECT sum(cityHash64(*)) FROM test.large_alter_table_00804;
|
||||
INSERT INTO store_of_hash_00804 SELECT sum(cityHash64(*)) FROM large_alter_table_00804;
|
||||
|
||||
ALTER TABLE test.large_alter_table_00804 MODIFY COLUMN data CODEC(NONE, LZ4, LZ4HC, ZSTD);
|
||||
ALTER TABLE large_alter_table_00804 MODIFY COLUMN data CODEC(NONE, LZ4, LZ4HC, ZSTD);
|
||||
|
||||
OPTIMIZE TABLE test.large_alter_table_00804;
|
||||
OPTIMIZE TABLE large_alter_table_00804;
|
||||
|
||||
SELECT compression_codec FROM system.columns WHERE database = 'test' AND table = 'large_alter_table_00804' AND name = 'data';
|
||||
SELECT compression_codec FROM system.columns WHERE database = currentDatabase() AND table = 'large_alter_table_00804' AND name = 'data';
|
||||
|
||||
DETACH TABLE test.large_alter_table_00804;
|
||||
ATTACH TABLE test.large_alter_table_00804;
|
||||
DETACH TABLE large_alter_table_00804;
|
||||
ATTACH TABLE large_alter_table_00804;
|
||||
|
||||
INSERT INTO test.store_of_hash_00804 SELECT sum(cityHash64(*)) FROM test.large_alter_table_00804;
|
||||
INSERT INTO store_of_hash_00804 SELECT sum(cityHash64(*)) FROM large_alter_table_00804;
|
||||
|
||||
SELECT COUNT(hash) FROM test.store_of_hash_00804;
|
||||
SELECT COUNT(DISTINCT hash) FROM test.store_of_hash_00804;
|
||||
SELECT COUNT(hash) FROM store_of_hash_00804;
|
||||
SELECT COUNT(DISTINCT hash) FROM store_of_hash_00804;
|
||||
|
||||
DROP TABLE IF EXISTS test.large_alter_table_00804;
|
||||
DROP TABLE IF EXISTS test.store_of_hash_00804;
|
||||
DROP TABLE IF EXISTS large_alter_table_00804;
|
||||
DROP TABLE IF EXISTS store_of_hash_00804;
|
||||
|
@ -9,10 +9,10 @@
|
||||
10003
|
||||
274972506.6
|
||||
9175437371954010821
|
||||
CREATE TABLE test.compression_codec_multiple_more_types (`id` Decimal(38, 13) CODEC(ZSTD(1), LZ4, ZSTD(1), ZSTD(1), Delta(2), Delta(4), Delta(1), LZ4HC(0)), `data` FixedString(12) CODEC(ZSTD(1), ZSTD(1), Delta(1), Delta(1), Delta(1), NONE, NONE, NONE, LZ4HC(0)), `ddd.age` Array(UInt8) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8)), `ddd.Name` Array(String) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8))) ENGINE = MergeTree() ORDER BY tuple() SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.compression_codec_multiple_more_types (`id` Decimal(38, 13) CODEC(ZSTD(1), LZ4, ZSTD(1), ZSTD(1), Delta(2), Delta(4), Delta(1), LZ4HC(0)), `data` FixedString(12) CODEC(ZSTD(1), ZSTD(1), Delta(1), Delta(1), Delta(1), NONE, NONE, NONE, LZ4HC(0)), `ddd.age` Array(UInt8) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8)), `ddd.Name` Array(String) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8))) ENGINE = MergeTree() ORDER BY tuple() SETTINGS index_granularity = 8192
|
||||
1.5555555555555 hello world! [77] ['John']
|
||||
7.1000000000000 xxxxxxxxxxxx [127] ['Henry']
|
||||
!
|
||||
222
|
||||
!ZSTD
|
||||
CREATE TABLE test.test_default_delta (`id` UInt64 CODEC(Delta(8)), `data` String CODEC(Delta(1)), `somedate` Date CODEC(Delta(2)), `somenum` Float64 CODEC(Delta(8)), `somestr` FixedString(3) CODEC(Delta(1)), `othernum` Int64 CODEC(Delta(8)), `yetothernum` Float32 CODEC(Delta(4)), `ddd.age` Array(UInt8) CODEC(Delta(1)), `ddd.Name` Array(String) CODEC(Delta(1)), `ddd.OName` Array(String) CODEC(Delta(1)), `ddd.BName` Array(String) CODEC(Delta(1))) ENGINE = MergeTree() ORDER BY tuple() SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.test_default_delta (`id` UInt64 CODEC(Delta(8)), `data` String CODEC(Delta(1)), `somedate` Date CODEC(Delta(2)), `somenum` Float64 CODEC(Delta(8)), `somestr` FixedString(3) CODEC(Delta(1)), `othernum` Int64 CODEC(Delta(8)), `yetothernum` Float32 CODEC(Delta(4)), `ddd.age` Array(UInt8) CODEC(Delta(1)), `ddd.Name` Array(String) CODEC(Delta(1)), `ddd.OName` Array(String) CODEC(Delta(1)), `ddd.BName` Array(String) CODEC(Delta(1))) ENGINE = MergeTree() ORDER BY tuple() SETTINGS index_granularity = 8192
|
||||
|
@ -1,8 +1,8 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec;
|
||||
DROP TABLE IF EXISTS compression_codec;
|
||||
|
||||
CREATE TABLE test.compression_codec(
|
||||
CREATE TABLE compression_codec(
|
||||
id UInt64 CODEC(LZ4),
|
||||
data String CODEC(ZSTD),
|
||||
ddd Date CODEC(NONE),
|
||||
@ -11,124 +11,124 @@ CREATE TABLE test.compression_codec(
|
||||
othernum Int64 CODEC(Delta)
|
||||
) ENGINE = MergeTree() ORDER BY tuple();
|
||||
|
||||
INSERT INTO test.compression_codec VALUES(1, 'hello', toDate('2018-12-14'), 1.1, 'aaa', 5);
|
||||
INSERT INTO test.compression_codec VALUES(2, 'world', toDate('2018-12-15'), 2.2, 'bbb', 6);
|
||||
INSERT INTO test.compression_codec VALUES(3, '!', toDate('2018-12-16'), 3.3, 'ccc', 7);
|
||||
INSERT INTO compression_codec VALUES(1, 'hello', toDate('2018-12-14'), 1.1, 'aaa', 5);
|
||||
INSERT INTO compression_codec VALUES(2, 'world', toDate('2018-12-15'), 2.2, 'bbb', 6);
|
||||
INSERT INTO compression_codec VALUES(3, '!', toDate('2018-12-16'), 3.3, 'ccc', 7);
|
||||
|
||||
SELECT * FROM test.compression_codec ORDER BY id;
|
||||
SELECT * FROM compression_codec ORDER BY id;
|
||||
|
||||
OPTIMIZE TABLE test.compression_codec FINAL;
|
||||
OPTIMIZE TABLE compression_codec FINAL;
|
||||
|
||||
INSERT INTO test.compression_codec VALUES(2, '', toDate('2018-12-13'), 4.4, 'ddd', 8);
|
||||
INSERT INTO compression_codec VALUES(2, '', toDate('2018-12-13'), 4.4, 'ddd', 8);
|
||||
|
||||
DETACH TABLE test.compression_codec;
|
||||
ATTACH TABLE test.compression_codec;
|
||||
DETACH TABLE compression_codec;
|
||||
ATTACH TABLE compression_codec;
|
||||
|
||||
SELECT count(*) FROM test.compression_codec WHERE id = 2 GROUP BY id;
|
||||
SELECT count(*) FROM compression_codec WHERE id = 2 GROUP BY id;
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec;
|
||||
DROP TABLE IF EXISTS compression_codec;
|
||||
|
||||
DROP TABLE IF EXISTS test.bad_codec;
|
||||
DROP TABLE IF EXISTS test.params_when_no_params;
|
||||
DROP TABLE IF EXISTS test.too_many_params;
|
||||
DROP TABLE IF EXISTS test.codec_multiple_direct_specification_1;
|
||||
DROP TABLE IF EXISTS test.codec_multiple_direct_specification_2;
|
||||
DROP TABLE IF EXISTS test.delta_bad_params1;
|
||||
DROP TABLE IF EXISTS test.delta_bad_params2;
|
||||
DROP TABLE IF EXISTS bad_codec;
|
||||
DROP TABLE IF EXISTS params_when_no_params;
|
||||
DROP TABLE IF EXISTS too_many_params;
|
||||
DROP TABLE IF EXISTS codec_multiple_direct_specification_1;
|
||||
DROP TABLE IF EXISTS codec_multiple_direct_specification_2;
|
||||
DROP TABLE IF EXISTS delta_bad_params1;
|
||||
DROP TABLE IF EXISTS delta_bad_params2;
|
||||
|
||||
CREATE TABLE test.bad_codec(id UInt64 CODEC(adssadads)) ENGINE = MergeTree() order by tuple(); -- { serverError 432 }
|
||||
CREATE TABLE test.too_many_params(id UInt64 CODEC(ZSTD(2,3,4,5))) ENGINE = MergeTree() order by tuple(); -- { serverError 431 }
|
||||
CREATE TABLE test.params_when_no_params(id UInt64 CODEC(LZ4(1))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 378 }
|
||||
CREATE TABLE test.codec_multiple_direct_specification_1(id UInt64 CODEC(MULTIPLE(LZ4, ZSTD))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 432 }
|
||||
CREATE TABLE test.codec_multiple_direct_specification_2(id UInt64 CODEC(multiple(LZ4, ZSTD))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 432 }
|
||||
CREATE TABLE test.delta_bad_params1(id UInt64 CODEC(Delta(3))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 433 }
|
||||
CREATE TABLE test.delta_bad_params2(id UInt64 CODEC(Delta(16))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 433 }
|
||||
CREATE TABLE bad_codec(id UInt64 CODEC(adssadads)) ENGINE = MergeTree() order by tuple(); -- { serverError 432 }
|
||||
CREATE TABLE too_many_params(id UInt64 CODEC(ZSTD(2,3,4,5))) ENGINE = MergeTree() order by tuple(); -- { serverError 431 }
|
||||
CREATE TABLE params_when_no_params(id UInt64 CODEC(LZ4(1))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 378 }
|
||||
CREATE TABLE codec_multiple_direct_specification_1(id UInt64 CODEC(MULTIPLE(LZ4, ZSTD))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 432 }
|
||||
CREATE TABLE codec_multiple_direct_specification_2(id UInt64 CODEC(multiple(LZ4, ZSTD))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 432 }
|
||||
CREATE TABLE delta_bad_params1(id UInt64 CODEC(Delta(3))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 433 }
|
||||
CREATE TABLE delta_bad_params2(id UInt64 CODEC(Delta(16))) ENGINE = MergeTree() ORDER BY tuple(); -- { serverError 433 }
|
||||
|
||||
DROP TABLE IF EXISTS test.bad_codec;
|
||||
DROP TABLE IF EXISTS test.params_when_no_params;
|
||||
DROP TABLE IF EXISTS test.too_many_params;
|
||||
DROP TABLE IF EXISTS test.codec_multiple_direct_specification_1;
|
||||
DROP TABLE IF EXISTS test.codec_multiple_direct_specification_2;
|
||||
DROP TABLE IF EXISTS test.delta_bad_params1;
|
||||
DROP TABLE IF EXISTS test.delta_bad_params2;
|
||||
DROP TABLE IF EXISTS bad_codec;
|
||||
DROP TABLE IF EXISTS params_when_no_params;
|
||||
DROP TABLE IF EXISTS too_many_params;
|
||||
DROP TABLE IF EXISTS codec_multiple_direct_specification_1;
|
||||
DROP TABLE IF EXISTS codec_multiple_direct_specification_2;
|
||||
DROP TABLE IF EXISTS delta_bad_params1;
|
||||
DROP TABLE IF EXISTS delta_bad_params2;
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec_multiple;
|
||||
DROP TABLE IF EXISTS compression_codec_multiple;
|
||||
|
||||
SET network_compression_method = 'lz4hc';
|
||||
|
||||
CREATE TABLE test.compression_codec_multiple (
|
||||
CREATE TABLE compression_codec_multiple (
|
||||
id UInt64 CODEC(LZ4, ZSTD, NONE, LZ4HC, Delta(4)),
|
||||
data String CODEC(ZSTD(2), NONE, Delta(2), LZ4HC, LZ4, LZ4, Delta(8)),
|
||||
ddd Date CODEC(NONE, NONE, NONE, Delta(1), LZ4, ZSTD, LZ4HC, LZ4HC),
|
||||
somenum Float64 CODEC(Delta(4), LZ4, LZ4, ZSTD(2), LZ4HC(5), ZSTD(3), ZSTD)
|
||||
) ENGINE = MergeTree() ORDER BY tuple();
|
||||
|
||||
INSERT INTO test.compression_codec_multiple VALUES (1, 'world', toDate('2018-10-05'), 1.1), (2, 'hello', toDate('2018-10-01'), 2.2), (3, 'buy', toDate('2018-10-11'), 3.3);
|
||||
INSERT INTO compression_codec_multiple VALUES (1, 'world', toDate('2018-10-05'), 1.1), (2, 'hello', toDate('2018-10-01'), 2.2), (3, 'buy', toDate('2018-10-11'), 3.3);
|
||||
|
||||
SELECT * FROM test.compression_codec_multiple ORDER BY id;
|
||||
SELECT * FROM compression_codec_multiple ORDER BY id;
|
||||
|
||||
INSERT INTO test.compression_codec_multiple select modulo(number, 100), toString(number), toDate('2018-12-01'), 5.5 * number FROM system.numbers limit 10000;
|
||||
INSERT INTO compression_codec_multiple select modulo(number, 100), toString(number), toDate('2018-12-01'), 5.5 * number FROM system.numbers limit 10000;
|
||||
|
||||
SELECT count(*) FROM test.compression_codec_multiple;
|
||||
SELECT count(*) FROM compression_codec_multiple;
|
||||
|
||||
SELECT count(distinct data) FROM test.compression_codec_multiple;
|
||||
SELECT count(distinct data) FROM compression_codec_multiple;
|
||||
|
||||
SELECT floor(sum(somenum), 1) FROM test.compression_codec_multiple;
|
||||
SELECT floor(sum(somenum), 1) FROM compression_codec_multiple;
|
||||
|
||||
TRUNCATE TABLE test.compression_codec_multiple;
|
||||
TRUNCATE TABLE compression_codec_multiple;
|
||||
|
||||
INSERT INTO test.compression_codec_multiple select modulo(number, 100), toString(number), toDate('2018-12-01'), 5.5 * number FROM system.numbers limit 10000;
|
||||
INSERT INTO compression_codec_multiple select modulo(number, 100), toString(number), toDate('2018-12-01'), 5.5 * number FROM system.numbers limit 10000;
|
||||
|
||||
SELECT sum(cityHash64(*)) FROM test.compression_codec_multiple;
|
||||
SELECT sum(cityHash64(*)) FROM compression_codec_multiple;
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec_multiple_more_types;
|
||||
DROP TABLE IF EXISTS compression_codec_multiple_more_types;
|
||||
|
||||
CREATE TABLE test.compression_codec_multiple_more_types (
|
||||
CREATE TABLE compression_codec_multiple_more_types (
|
||||
id Decimal128(13) CODEC(ZSTD, LZ4, ZSTD, ZSTD, Delta(2), Delta(4), Delta(1), LZ4HC),
|
||||
data FixedString(12) CODEC(ZSTD, ZSTD, Delta, Delta, Delta, NONE, NONE, NONE, LZ4HC),
|
||||
ddd Nested (age UInt8, Name String) CODEC(LZ4, LZ4HC, NONE, NONE, NONE, ZSTD, Delta(8))
|
||||
) ENGINE = MergeTree() ORDER BY tuple();
|
||||
|
||||
SHOW CREATE TABLE test.compression_codec_multiple_more_types;
|
||||
SHOW CREATE TABLE compression_codec_multiple_more_types;
|
||||
|
||||
INSERT INTO test.compression_codec_multiple_more_types VALUES(1.5555555555555, 'hello world!', [77], ['John']);
|
||||
INSERT INTO test.compression_codec_multiple_more_types VALUES(7.1, 'xxxxxxxxxxxx', [127], ['Henry']);
|
||||
INSERT INTO compression_codec_multiple_more_types VALUES(1.5555555555555, 'hello world!', [77], ['John']);
|
||||
INSERT INTO compression_codec_multiple_more_types VALUES(7.1, 'xxxxxxxxxxxx', [127], ['Henry']);
|
||||
|
||||
SELECT * FROM test.compression_codec_multiple_more_types order by id;
|
||||
SELECT * FROM compression_codec_multiple_more_types order by id;
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec_multiple_with_key;
|
||||
DROP TABLE IF EXISTS compression_codec_multiple_with_key;
|
||||
|
||||
SET network_compression_method = 'zstd';
|
||||
SET network_zstd_compression_level = 5;
|
||||
|
||||
CREATE TABLE test.compression_codec_multiple_with_key (
|
||||
CREATE TABLE compression_codec_multiple_with_key (
|
||||
somedate Date CODEC(ZSTD, ZSTD, ZSTD(12), LZ4HC(12), Delta, Delta),
|
||||
id UInt64 CODEC(LZ4, ZSTD, Delta, NONE, LZ4HC, Delta),
|
||||
data String CODEC(ZSTD(2), Delta, LZ4HC, NONE, LZ4, LZ4)
|
||||
) ENGINE = MergeTree() PARTITION BY somedate ORDER BY id SETTINGS index_granularity = 2;
|
||||
|
||||
|
||||
INSERT INTO test.compression_codec_multiple_with_key VALUES(toDate('2018-10-12'), 100000, 'hello'), (toDate('2018-10-12'), 100002, 'world'), (toDate('2018-10-12'), 1111, '!');
|
||||
INSERT INTO compression_codec_multiple_with_key VALUES(toDate('2018-10-12'), 100000, 'hello'), (toDate('2018-10-12'), 100002, 'world'), (toDate('2018-10-12'), 1111, '!');
|
||||
|
||||
SELECT data FROM test.compression_codec_multiple_with_key WHERE id BETWEEN 3 AND 1112;
|
||||
SELECT data FROM compression_codec_multiple_with_key WHERE id BETWEEN 3 AND 1112;
|
||||
|
||||
INSERT INTO test.compression_codec_multiple_with_key SELECT toDate('2018-10-12'), number, toString(number) FROM system.numbers LIMIT 1000;
|
||||
INSERT INTO compression_codec_multiple_with_key SELECT toDate('2018-10-12'), number, toString(number) FROM system.numbers LIMIT 1000;
|
||||
|
||||
SELECT COUNT(DISTINCT data) FROM test.compression_codec_multiple_with_key WHERE id < 222;
|
||||
SELECT COUNT(DISTINCT data) FROM compression_codec_multiple_with_key WHERE id < 222;
|
||||
|
||||
-- method in lowercase
|
||||
SET network_compression_method = 'ZSTD';
|
||||
SET network_zstd_compression_level = 7;
|
||||
|
||||
INSERT INTO test.compression_codec_multiple_with_key VALUES(toDate('2018-10-13'), 100001, 'hello1'), (toDate('2018-10-14'), 100003, 'world1'), (toDate('2018-10-15'), 2222, '!ZSTD');
|
||||
INSERT INTO compression_codec_multiple_with_key VALUES(toDate('2018-10-13'), 100001, 'hello1'), (toDate('2018-10-14'), 100003, 'world1'), (toDate('2018-10-15'), 2222, '!ZSTD');
|
||||
|
||||
SELECT data FROM test.compression_codec_multiple_with_key WHERE id = 2222;
|
||||
SELECT data FROM compression_codec_multiple_with_key WHERE id = 2222;
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec_multiple_with_key;
|
||||
DROP TABLE IF EXISTS compression_codec_multiple_with_key;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_default_delta;
|
||||
DROP TABLE IF EXISTS test_default_delta;
|
||||
|
||||
CREATE TABLE test.test_default_delta(
|
||||
CREATE TABLE test_default_delta(
|
||||
id UInt64 CODEC(Delta),
|
||||
data String CODEC(Delta),
|
||||
somedate Date CODEC(Delta),
|
||||
@ -139,6 +139,8 @@ CREATE TABLE test.test_default_delta(
|
||||
ddd Nested (age UInt8, Name String, OName String, BName String) CODEC(Delta)
|
||||
) ENGINE = MergeTree() ORDER BY tuple();
|
||||
|
||||
SHOW CREATE TABLE test.test_default_delta;
|
||||
SHOW CREATE TABLE test_default_delta;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_default_delta;
|
||||
DROP TABLE IF EXISTS test_default_delta;
|
||||
DROP TABLE compression_codec_multiple;
|
||||
DROP TABLE compression_codec_multiple_more_types;
|
||||
|
@ -1,9 +1,9 @@
|
||||
CREATE TABLE test.compression_codec_log (`id` UInt64 CODEC(LZ4), `data` String CODEC(ZSTD(1)), `ddd` Date CODEC(NONE), `somenum` Float64 CODEC(ZSTD(2)), `somestr` FixedString(3) CODEC(LZ4HC(7)), `othernum` Int64 CODEC(Delta(8))) ENGINE = Log()
|
||||
CREATE TABLE default.compression_codec_log (`id` UInt64 CODEC(LZ4), `data` String CODEC(ZSTD(1)), `ddd` Date CODEC(NONE), `somenum` Float64 CODEC(ZSTD(2)), `somestr` FixedString(3) CODEC(LZ4HC(7)), `othernum` Int64 CODEC(Delta(8))) ENGINE = Log()
|
||||
1 hello 2018-12-14 1.1 aaa 5
|
||||
2 world 2018-12-15 2.2 bbb 6
|
||||
3 ! 2018-12-16 3.3 ccc 7
|
||||
2
|
||||
CREATE TABLE test.compression_codec_multiple_log (`id` UInt64 CODEC(LZ4, ZSTD(1), NONE, LZ4HC(0), Delta(4)), `data` String CODEC(ZSTD(2), NONE, Delta(2), LZ4HC(0), LZ4, LZ4, Delta(8)), `ddd` Date CODEC(NONE, NONE, NONE, Delta(1), LZ4, ZSTD(1), LZ4HC(0), LZ4HC(0)), `somenum` Float64 CODEC(Delta(4), LZ4, LZ4, ZSTD(2), LZ4HC(5), ZSTD(3), ZSTD(1))) ENGINE = Log()
|
||||
CREATE TABLE default.compression_codec_multiple_log (`id` UInt64 CODEC(LZ4, ZSTD(1), NONE, LZ4HC(0), Delta(4)), `data` String CODEC(ZSTD(2), NONE, Delta(2), LZ4HC(0), LZ4, LZ4, Delta(8)), `ddd` Date CODEC(NONE, NONE, NONE, Delta(1), LZ4, ZSTD(1), LZ4HC(0), LZ4HC(0)), `somenum` Float64 CODEC(Delta(4), LZ4, LZ4, ZSTD(2), LZ4HC(5), ZSTD(3), ZSTD(1))) ENGINE = Log()
|
||||
1 world 2018-10-05 1.1
|
||||
2 hello 2018-10-01 2.2
|
||||
3 buy 2018-10-11 3.3
|
||||
@ -11,12 +11,12 @@ CREATE TABLE test.compression_codec_multiple_log (`id` UInt64 CODEC(LZ4, ZSTD(1)
|
||||
10003
|
||||
274972506.6
|
||||
9175437371954010821
|
||||
CREATE TABLE test.compression_codec_tiny_log (`id` UInt64 CODEC(LZ4), `data` String CODEC(ZSTD(1)), `ddd` Date CODEC(NONE), `somenum` Float64 CODEC(ZSTD(2)), `somestr` FixedString(3) CODEC(LZ4HC(7)), `othernum` Int64 CODEC(Delta(8))) ENGINE = TinyLog()
|
||||
CREATE TABLE default.compression_codec_tiny_log (`id` UInt64 CODEC(LZ4), `data` String CODEC(ZSTD(1)), `ddd` Date CODEC(NONE), `somenum` Float64 CODEC(ZSTD(2)), `somestr` FixedString(3) CODEC(LZ4HC(7)), `othernum` Int64 CODEC(Delta(8))) ENGINE = TinyLog()
|
||||
1 hello 2018-12-14 1.1 aaa 5
|
||||
2 world 2018-12-15 2.2 bbb 6
|
||||
3 ! 2018-12-16 3.3 ccc 7
|
||||
2
|
||||
CREATE TABLE test.compression_codec_multiple_tiny_log (`id` UInt64 CODEC(LZ4, ZSTD(1), NONE, LZ4HC(0), Delta(4)), `data` String CODEC(ZSTD(2), NONE, Delta(2), LZ4HC(0), LZ4, LZ4, Delta(8)), `ddd` Date CODEC(NONE, NONE, NONE, Delta(1), LZ4, ZSTD(1), LZ4HC(0), LZ4HC(0)), `somenum` Float64 CODEC(Delta(4), LZ4, LZ4, ZSTD(2), LZ4HC(5), ZSTD(3), ZSTD(1))) ENGINE = TinyLog()
|
||||
CREATE TABLE default.compression_codec_multiple_tiny_log (`id` UInt64 CODEC(LZ4, ZSTD(1), NONE, LZ4HC(0), Delta(4)), `data` String CODEC(ZSTD(2), NONE, Delta(2), LZ4HC(0), LZ4, LZ4, Delta(8)), `ddd` Date CODEC(NONE, NONE, NONE, Delta(1), LZ4, ZSTD(1), LZ4HC(0), LZ4HC(0)), `somenum` Float64 CODEC(Delta(4), LZ4, LZ4, ZSTD(2), LZ4HC(5), ZSTD(3), ZSTD(1))) ENGINE = TinyLog()
|
||||
1 world 2018-10-05 1.1
|
||||
2 hello 2018-10-01 2.2
|
||||
3 buy 2018-10-11 3.3
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user