mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
fix TTL with GROUP BY
This commit is contained in:
parent
b60c00ba74
commit
a8f1786d95
@ -26,7 +26,6 @@ void TTLColumnAlgorithm::execute(Block & block)
|
||||
if (!block)
|
||||
return;
|
||||
|
||||
|
||||
/// If we read not all table columns. E.g. while mutation.
|
||||
if (!block.has(column_name))
|
||||
return;
|
||||
|
@ -211,9 +211,12 @@ TTLDescription TTLDescription::getTTLFromAST(
|
||||
const auto & primary_key_expressions = primary_key.expression_list_ast->children;
|
||||
for (size_t i = ttl_element->group_by_key.size(); i < primary_key_expressions.size(); ++i)
|
||||
{
|
||||
ASTPtr expr = makeASTFunction("any", primary_key_expressions[i]->clone());
|
||||
aggregations.emplace_back(pk_columns[i], std::move(expr));
|
||||
aggregation_columns_set.insert(pk_columns[i]);
|
||||
if (!aggregation_columns_set.count(pk_columns[i]))
|
||||
{
|
||||
ASTPtr expr = makeASTFunction("any", primary_key_expressions[i]->clone());
|
||||
aggregations.emplace_back(pk_columns[i], std::move(expr));
|
||||
aggregation_columns_set.insert(pk_columns[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto & column : columns.getOrdinary())
|
||||
|
Loading…
Reference in New Issue
Block a user