Handle read from wide part when no columns are requested

This commit is contained in:
Alexander Gololobov 2022-06-10 11:44:53 +02:00
parent 935c9e454f
commit e5c0ebc7b5

View File

@ -67,9 +67,13 @@ size_t MergeTreeReaderWide::readRows(
size_t read_rows = 0; size_t read_rows = 0;
try try
{ {
size_t num_columns = columns.size(); size_t num_columns = res_columns.size();
checkNumberOfColumns(num_columns); checkNumberOfColumns(num_columns);
/// TODO: is this ok to request no columns?
if (num_columns == 0)
return max_rows_to_read;
std::unordered_map<String, ISerialization::SubstreamsCache> caches; std::unordered_map<String, ISerialization::SubstreamsCache> caches;
std::unordered_set<std::string> prefetched_streams; std::unordered_set<std::string> prefetched_streams;