mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Check TTL in StorageFactory
This commit is contained in:
parent
d1eb9b197b
commit
b2109e4ece
@ -104,11 +104,12 @@ StoragePtr StorageFactory::get(
|
||||
}
|
||||
|
||||
if ((storage_def->partition_by || storage_def->primary_key || storage_def->order_by || storage_def->sample_by ||
|
||||
(query.columns_list && query.columns_list->indices && !query.columns_list->indices->children.empty()))
|
||||
storage_def->ttl_table || !columns.getColumnTTLs().empty() ||
|
||||
(query.columns_list && query.columns_list->indices && !query.columns_list->indices->children.empty()))
|
||||
&& !endsWith(name, "MergeTree"))
|
||||
{
|
||||
throw Exception(
|
||||
"Engine " + name + " doesn't support PARTITION BY, PRIMARY KEY, ORDER BY or SAMPLE BY clauses and skipping indices. "
|
||||
"Engine " + name + " doesn't support PARTITION BY, PRIMARY KEY, ORDER BY, TTL or SAMPLE BY clauses and skipping indices. "
|
||||
"Currently only the MergeTree family of engines supports them", ErrorCodes::BAD_ARGUMENTS);
|
||||
}
|
||||
|
||||
|
@ -57,4 +57,7 @@ create table ttl_00933_1 (d DateTime, a Int ttl 2 + 2) engine = MergeTree order
|
||||
create table ttl_00933_1 (d DateTime, a Int ttl toDateTime(1)) engine = MergeTree order by tuple() partition by toSecond(d); -- { serverError 450 }
|
||||
create table ttl_00933_1 (d DateTime, a Int ttl d - d) engine = MergeTree order by tuple() partition by toSecond(d); -- { serverError 450 }
|
||||
|
||||
create table ttl_00933_1 (d DateTime, a Int ttl d + interval 1 day) engine = Log; -- { serverError 36 }
|
||||
create table ttl_00933_1 (d DateTime, a Int) engine = Log ttl d + interval 1 day; -- { serverError 36 }
|
||||
|
||||
drop table if exists ttl_00933_1;
|
||||
|
Loading…
Reference in New Issue
Block a user