Merge pull request #41564 from kssenii/system-parts-update

Add has_lightweight_delete to system.parts
This commit is contained in:
Kseniia Sumarokova 2022-09-21 12:13:07 +02:00 committed by GitHub
commit a02fede0e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -90,6 +90,8 @@ StorageSystemParts::StorageSystemParts(const StorageID & table_id_)
{"removal_tid", getTransactionIDDataType()},
{"creation_csn", std::make_shared<DataTypeUInt64>()},
{"removal_csn", std::make_shared<DataTypeUInt64>()},
{"has_lightweight_delete", std::make_shared<DataTypeUInt8>()},
}
)
{
@ -305,6 +307,8 @@ void StorageSystemParts::processNextStorage(
columns[res_index++]->insert(part->version.creation_csn.load(std::memory_order_relaxed));
if (columns_mask[src_index++])
columns[res_index++]->insert(part->version.removal_csn.load(std::memory_order_relaxed));
if (columns_mask[src_index++])
columns[res_index++]->insert(part->hasLightweightDelete());
/// _state column should be the latest.
/// Do not use part->getState*, it can be changed from different thread

View File

@ -480,6 +480,7 @@ CREATE TABLE system.parts
`removal_tid` Tuple(UInt64, UInt64, UUID),
`creation_csn` UInt64,
`removal_csn` UInt64,
`has_lightweight_delete` UInt8,
`bytes` UInt64,
`marks_size` UInt64
)