token_info is defined always

This commit is contained in:
Sema Checherinda 2024-07-03 13:16:01 +02:00
parent f6a2c3156b
commit 10d48afc20

View File

@ -297,16 +297,13 @@ void ReplicatedMergeTreeSinkImpl<async_insert>::consume(Chunk & chunk)
String block_dedup_token;
auto token_info = chunk.getChunkInfos().get<DeduplicationToken::TokenInfo>();
if constexpr (!async_insert)
{
if (!token_info)
throw Exception(ErrorCodes::LOGICAL_ERROR,
"TokenInfo is expected for consumed chunk in ReplicatedMergeTreeSink for table: {}",
storage.getStorageID().getNameForLogs());
if (!token_info)
throw Exception(ErrorCodes::LOGICAL_ERROR,
"TokenInfo is expected for consumed chunk in ReplicatedMergeTreeSink for table: {}",
storage.getStorageID().getNameForLogs());
if (token_info->isDefined())
block_dedup_token = token_info->getToken();
}
if (token_info->isDefined())
block_dedup_token = token_info->getToken();
auto part_blocks = MergeTreeDataWriter::splitBlockIntoParts(std::move(block), max_parts_per_block, metadata_snapshot, context, async_insert_info);