mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
ColumnSparse: fix TTL
This commit is contained in:
parent
f2c4e0ff01
commit
d571d099bd
@ -104,6 +104,9 @@ Block TTLBlockInputStream::readImpl()
|
||||
return {};
|
||||
|
||||
auto block = children.at(0)->read();
|
||||
for (auto & column : block)
|
||||
column.column = recursiveRemoveSparse(column.column);
|
||||
|
||||
for (const auto & algorithm : algorithms)
|
||||
algorithm->execute(block);
|
||||
|
||||
|
@ -29,15 +29,23 @@ NameSet IMergedBlockOutputStream::removeEmptyColumnsFromPart(
|
||||
|
||||
/// Collect counts for shared streams of different columns. As an example, Nested columns have shared stream with array sizes.
|
||||
std::map<String, size_t> stream_counts;
|
||||
std::unordered_map<String, SerializationPtr> serialziations;
|
||||
for (const NameAndTypePair & column : columns)
|
||||
{
|
||||
auto serialization = data_part->getSerializationForColumn(column);
|
||||
auto serialization = IDataType::getSerialization(column, [&](const String & stream_name)
|
||||
{
|
||||
/// Checksums of data_part are not initialized here.
|
||||
return checksums.files.count(stream_name + IMergeTreeDataPart::DATA_FILE_EXTENSION) != 0;
|
||||
});
|
||||
|
||||
serialization->enumerateStreams(
|
||||
[&](const ISerialization::SubstreamPath & substream_path)
|
||||
{
|
||||
++stream_counts[ISerialization::getFileNameForStream(column, substream_path)];
|
||||
},
|
||||
{});
|
||||
|
||||
serialziations[column.name] = std::move(serialization);
|
||||
}
|
||||
|
||||
NameSet remove_files;
|
||||
@ -59,8 +67,7 @@ NameSet IMergedBlockOutputStream::removeEmptyColumnsFromPart(
|
||||
}
|
||||
};
|
||||
|
||||
auto serialization = data_part->getSerializationForColumn(*column_with_type);
|
||||
serialization->enumerateStreams(callback);
|
||||
serialziations[column_name]->enumerateStreams(callback);
|
||||
}
|
||||
|
||||
/// Remove files on disk and checksums
|
||||
|
Loading…
Reference in New Issue
Block a user