mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 10:34:21 +00:00
better checking if table has TTL
This commit is contained in:
parent
14f0b9e137
commit
a5d9975e37
@ -3914,8 +3914,8 @@ Names MergeTreeData::getColumnsRequiredForTTL() const
|
||||
res.insert(columns_vec.begin(), columns_vec.end());
|
||||
};
|
||||
|
||||
if (hasTableTTL())
|
||||
add_columns_to_set(ttl_table_entry.expression);
|
||||
if (hasRowsTTL())
|
||||
add_columns_to_set(rows_ttl_entry.expression);
|
||||
|
||||
for (const auto & [_, entry] : column_ttl_entries_by_name)
|
||||
add_columns_to_set(entry.expression);
|
||||
@ -3928,7 +3928,7 @@ Names MergeTreeData::getColumnsRequiredForTTL() const
|
||||
|
||||
Names MergeTreeData::getColumnsUpdatedByTTL() const
|
||||
{
|
||||
if (hasTableTTL())
|
||||
if (hasRowsTTL())
|
||||
return getColumns().getAllPhysical().getNames();
|
||||
|
||||
Names res;
|
||||
|
@ -652,7 +652,7 @@ bool StorageMergeTree::merge(
|
||||
{
|
||||
/// Force filter by TTL in 'OPTIMIZE ... FINAL' query to remove expired values from old parts
|
||||
/// without TTL infos or with outdated TTL infos, e.g. after 'ALTER ... MODIFY TTL' query.
|
||||
bool force_ttl = (final && (hasRowsTTL() || hasAnyColumnTTL()));
|
||||
bool force_ttl = (final && hasAnyTTL());
|
||||
|
||||
new_part = merger_mutator.mergePartsToTemporaryPart(
|
||||
future_part, *merge_entry, table_lock_holder, time(nullptr),
|
||||
|
@ -3133,7 +3133,7 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p
|
||||
return false;
|
||||
};
|
||||
|
||||
bool force_ttl = (final && (hasRowsTTL() || hasAnyColumnTTL()));
|
||||
bool force_ttl = (final && hasAnyTTL());
|
||||
const auto storage_settings_ptr = getSettings();
|
||||
|
||||
if (!partition && final)
|
||||
|
Loading…
Reference in New Issue
Block a user