mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 21:20:49 +00:00
fix TTLs with WHERE
This commit is contained in:
parent
15ead18673
commit
0e903552a0
@ -44,7 +44,7 @@ TTLBlockInputStream::TTLBlockInputStream(
|
||||
algorithms.emplace_back(std::move(algorithm));
|
||||
}
|
||||
|
||||
for (const auto & where_ttl : metadata_snapshot_->getRowsWhereTTL())
|
||||
for (const auto & where_ttl : metadata_snapshot_->getRowsWhereTTLs())
|
||||
algorithms.emplace_back(std::make_unique<TTLDeleteAlgorithm>(
|
||||
where_ttl, old_ttl_infos.rows_where_ttl[where_ttl.result_column], current_time_, force_));
|
||||
|
||||
|
@ -1142,7 +1142,7 @@ bool IMergeTreeDataPart::checkAllTTLCalculated(const StorageMetadataPtr & metada
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const auto & rows_where_desc : metadata_snapshot->getRowsWhereTTL())
|
||||
for (const auto & rows_where_desc : metadata_snapshot->getRowsWhereTTLs())
|
||||
{
|
||||
if (!ttl_infos.rows_where_ttl.count(rows_where_desc.result_column))
|
||||
return false;
|
||||
|
@ -377,7 +377,7 @@ MergeTreeData::MutableDataPartPtr MergeTreeDataWriter::writeTempPart(BlockWithPa
|
||||
for (const auto & ttl_entry : metadata_snapshot->getGroupByTTLs())
|
||||
updateTTL(ttl_entry, new_data_part->ttl_infos, new_data_part->ttl_infos.group_by_ttl[ttl_entry.result_column], block, true);
|
||||
|
||||
for (const auto & ttl_entry : metadata_snapshot->getRowsWhereTTL())
|
||||
for (const auto & ttl_entry : metadata_snapshot->getRowsWhereTTLs())
|
||||
updateTTL(ttl_entry, new_data_part->ttl_infos, new_data_part->ttl_infos.rows_where_ttl[ttl_entry.result_column], block, true);
|
||||
|
||||
for (const auto & [name, ttl_entry] : metadata_snapshot->getColumnTTLs())
|
||||
|
@ -125,7 +125,7 @@ TTLTableDescription StorageInMemoryMetadata::getTableTTLs() const
|
||||
|
||||
bool StorageInMemoryMetadata::hasAnyTableTTL() const
|
||||
{
|
||||
return hasAnyMoveTTL() || hasRowsTTL() || hasAnyRecompressionTTL() || hasAnyGroupByTTL();
|
||||
return hasAnyMoveTTL() || hasRowsTTL() || hasAnyRecompressionTTL() || hasAnyGroupByTTL() || hasAnyRowsWhereTTL();
|
||||
}
|
||||
|
||||
TTLColumnsDescription StorageInMemoryMetadata::getColumnTTLs() const
|
||||
@ -148,12 +148,12 @@ bool StorageInMemoryMetadata::hasRowsTTL() const
|
||||
return table_ttl.rows_ttl.expression != nullptr;
|
||||
}
|
||||
|
||||
TTLDescriptions StorageInMemoryMetadata::getRowsWhereTTL() const
|
||||
TTLDescriptions StorageInMemoryMetadata::getRowsWhereTTLs() const
|
||||
{
|
||||
return table_ttl.rows_where_ttl;
|
||||
}
|
||||
|
||||
bool StorageInMemoryMetadata::hasRowsWhereTTL() const
|
||||
bool StorageInMemoryMetadata::hasAnyRowsWhereTTL() const
|
||||
{
|
||||
return !table_ttl.rows_where_ttl.empty();
|
||||
}
|
||||
|
@ -109,8 +109,8 @@ struct StorageInMemoryMetadata
|
||||
TTLDescription getRowsTTL() const;
|
||||
bool hasRowsTTL() const;
|
||||
|
||||
TTLDescriptions getRowsWhereTTL() const;
|
||||
bool hasRowsWhereTTL() const;
|
||||
TTLDescriptions getRowsWhereTTLs() const;
|
||||
bool hasAnyRowsWhereTTL() const;
|
||||
|
||||
/// Just wrapper for table TTLs, return moves (to disks or volumes) parts of
|
||||
/// table TTL.
|
||||
|
Loading…
Reference in New Issue
Block a user