Fix tests

This commit is contained in:
avogar 2024-11-22 20:29:02 +00:00
parent e1d0932b98
commit cb833a009a
3 changed files with 9 additions and 5 deletions

View File

@ -149,7 +149,8 @@ void MergeTreeReaderCompact::readData(
size_t rows_to_read,
const InputStreamGetter & getter,
ISerialization::SubstreamsCache & cache,
std::unordered_map<String, ColumnPtr> & columns_cache_for_subcolumns)
std::unordered_map<String, ColumnPtr> & columns_cache_for_subcolumns,
const ColumnNameLevel & name_level_for_offsets)
{
try
{
@ -172,7 +173,8 @@ void MergeTreeReaderCompact::readData(
const auto & type_in_storage = name_and_type.getTypeInStorage();
const auto & name_in_storage = name_and_type.getNameInStorage();
if (auto cache_for_subcolumns_it = columns_cache_for_subcolumns.find(name_in_storage); cache_for_subcolumns_it != columns_cache_for_subcolumns.end())
auto cache_for_subcolumns_it = columns_cache_for_subcolumns.find(name_in_storage);
if (!name_level_for_offsets.has_value() && cache_for_subcolumns_it != columns_cache_for_subcolumns.end())
{
auto subcolumn = type_in_storage->getSubcolumn(name_and_type.getSubcolumnName(), cache_for_subcolumns_it->second);
/// TODO: Avoid extra copying.
@ -195,7 +197,8 @@ void MergeTreeReaderCompact::readData(
else
column->assumeMutable()->insertRangeFrom(*subcolumn, 0, subcolumn->size());
columns_cache_for_subcolumns[name_in_storage] = temp_column;
if (!name_level_for_offsets.has_value())
columns_cache_for_subcolumns[name_in_storage] = temp_column;
}
}
else

View File

@ -46,7 +46,8 @@ protected:
size_t rows_to_read,
const InputStreamGetter & getter,
ISerialization::SubstreamsCache & cache,
std::unordered_map<String, ColumnPtr> & columns_cache_for_subcolumns);
std::unordered_map<String, ColumnPtr> & columns_cache_for_subcolumns,
const ColumnNameLevel & name_level_for_offsets);
void readPrefix(
const NameAndTypePair & name_and_type,

View File

@ -62,7 +62,7 @@ try
};
readPrefix(columns_to_read[pos], buffer_getter, buffer_getter_for_prefix, columns_for_offsets[pos]);
readData(columns_to_read[pos], column, rows_to_read, buffer_getter, cache, columns_cache_for_subcolumns);
readData(columns_to_read[pos], column, rows_to_read, buffer_getter, cache, columns_cache_for_subcolumns, columns_for_offsets[pos]);
}
++from_mark;