mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
move column level setting to the end of declaration
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
parent
ac76eecb1e
commit
f755e77534
@ -453,14 +453,6 @@ ASTPtr InterpreterCreateQuery::formatColumns(const ColumnsDescription & columns)
|
||||
column_declaration->children.push_back(column_declaration->codec);
|
||||
}
|
||||
|
||||
if (!column.settings.empty())
|
||||
{
|
||||
auto per_column_settings = std::make_shared<ASTSetQuery>();
|
||||
per_column_settings->is_standalone = false;
|
||||
per_column_settings->changes = column.settings;
|
||||
column_declaration->per_column_settings = std::move(per_column_settings);
|
||||
}
|
||||
|
||||
if (column.stat)
|
||||
{
|
||||
column_declaration->stat_type = column.stat->ast;
|
||||
@ -473,6 +465,14 @@ ASTPtr InterpreterCreateQuery::formatColumns(const ColumnsDescription & columns)
|
||||
column_declaration->children.push_back(column_declaration->ttl);
|
||||
}
|
||||
|
||||
if (!column.settings.empty())
|
||||
{
|
||||
auto per_column_settings = std::make_shared<ASTSetQuery>();
|
||||
per_column_settings->is_standalone = false;
|
||||
per_column_settings->changes = column.settings;
|
||||
column_declaration->per_column_settings = std::move(per_column_settings);
|
||||
}
|
||||
|
||||
columns_list->children.push_back(column_declaration_ptr);
|
||||
}
|
||||
|
||||
|
@ -39,12 +39,6 @@ ASTPtr ASTColumnDeclaration::clone() const
|
||||
res->children.push_back(res->codec);
|
||||
}
|
||||
|
||||
if (per_column_settings)
|
||||
{
|
||||
res->per_column_settings = per_column_settings->clone();
|
||||
res->children.push_back(res->per_column_settings);
|
||||
}
|
||||
|
||||
if (stat_type)
|
||||
{
|
||||
res->stat_type = stat_type->clone();
|
||||
@ -63,6 +57,12 @@ ASTPtr ASTColumnDeclaration::clone() const
|
||||
res->children.push_back(res->collation);
|
||||
}
|
||||
|
||||
if (per_column_settings)
|
||||
{
|
||||
res->per_column_settings = per_column_settings->clone();
|
||||
res->children.push_back(res->per_column_settings);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user