forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore per-column TTL in CREATE TABLE AS if new table engine does not…
… support it Follow-up for: ClickHouse#6968 Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
- Loading branch information
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/queries/0_stateless/02230_create_table_as_ignore_ttl.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CREATE TABLE default.data_02230_ttl | ||
( | ||
`date` Date, | ||
`key` Int32 | ||
) | ||
ENGINE = MergeTree | ||
ORDER BY key | ||
TTL date + 14 | ||
SETTINGS index_granularity = 8192 | ||
CREATE TABLE default.null_02230_ttl | ||
( | ||
`date` Date, | ||
`key` Int32 | ||
) | ||
ENGINE = Null | ||
CREATE TABLE default.data_02230_column_ttl | ||
( | ||
`date` Date, | ||
`value` Int32 TTL date + 7, | ||
`key` Int32 | ||
) | ||
ENGINE = MergeTree | ||
ORDER BY key | ||
TTL date + 14 | ||
SETTINGS index_granularity = 8192 | ||
CREATE TABLE default.null_02230_column_ttl | ||
( | ||
`date` Date, | ||
`value` Int32, | ||
`key` Int32 | ||
) | ||
ENGINE = Null |
18 changes: 18 additions & 0 deletions
18
tests/queries/0_stateless/02230_create_table_as_ignore_ttl.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
drop table if exists data_02230_ttl; | ||
drop table if exists null_02230_ttl; | ||
create table data_02230_ttl (date Date, key Int) Engine=MergeTree() order by key TTL date + 14; | ||
show create data_02230_ttl format TSVRaw; | ||
create table null_02230_ttl engine=Null() as data_02230_ttl; | ||
show create null_02230_ttl format TSVRaw; | ||
drop table data_02230_ttl; | ||
drop table null_02230_ttl; | ||
|
||
drop table if exists data_02230_column_ttl; | ||
drop table if exists null_02230_column_ttl; | ||
create table data_02230_column_ttl (date Date, value Int TTL date + 7, key Int) Engine=MergeTree() order by key TTL date + 14; | ||
show create data_02230_column_ttl format TSVRaw; | ||
create table null_02230_column_ttl engine=Null() as data_02230_column_ttl; | ||
-- check that order of columns is the same | ||
show create null_02230_column_ttl format TSVRaw; | ||
drop table data_02230_column_ttl; | ||
drop table null_02230_column_ttl; |