fix block number columns

This commit is contained in:
Anton Popov 2024-05-30 16:12:52 +00:00
parent 7047147db5
commit 6ab029b465

View File

@ -58,10 +58,10 @@ static Statistics getStatisticsForColumns(
for (const auto & column : columns_to_read) for (const auto & column : columns_to_read)
{ {
const auto & desc = all_columns.get(column.name); const auto * desc = all_columns.tryGet(column.name);
if (desc.stat) if (desc && desc->stat)
{ {
auto statistic = MergeTreeStatisticsFactory::instance().get(*desc.stat); auto statistic = MergeTreeStatisticsFactory::instance().get(*desc->stat);
statistics.push_back(std::move(statistic)); statistics.push_back(std::move(statistic));
} }
} }