ClickHouse/tests/queries/0_stateless/01455_default_compression.sql
alesapin 10c7a6c45e
Add ability to specify Default codec for columns (#14049)
* Add ability to specify DefaultCompression codec which correspond to settings specified in config.xml

* Fix style

* Rename DefaultCompression to simple Default

* Fix compression codec

* Better codec description representation

* Less strange code and one method

* Fix delta
2020-08-28 20:40:45 +03:00

30 lines
662 B
SQL

DROP TABLE IF EXISTS compress_table;
CREATE TABLE compress_table
(
key UInt64,
value1 String CODEC(Default),
value2 UInt64 CODEC(Delta, Default),
value3 String CODEC(ZSTD(10))
)
ENGINE = MergeTree()
ORDER BY key;
INSERT INTO compress_table VALUES(1, '1', '1', '1');
SELECT * FROM compress_table;
ALTER TABLE compress_table MODIFY COLUMN value3 CODEC(Default);
INSERT INTO compress_table VALUES(2, '2', '2', '2');
SELECT * FROM compress_table ORDER BY key;
DESCRIBE TABLE compress_table;
SHOW CREATE TABLE compress_table;
ALTER TABLE compress_table MODIFY COLUMN value2 CODEC(Default(5)); --{serverError 36}
DROP TABLE IF EXISTS compress_table;