updated MergeTreePrewhereRangeReader; renamed MergeTreePrewhereRangeReader to MergeTreeRangeReader

This commit is contained in:
Nikolai Kochetov 2018-02-20 15:26:09 +03:00
parent d2d0d570d8
commit d8b5f14dd7
2 changed files with 5 additions and 8 deletions

View File

@ -519,7 +519,7 @@ void MergeTreeRangeReader::continueReadingChain(ReadResult & result)
void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & result)
{
const auto & columns = stream.reader()->getColumns();
const auto & columns = merge_tree_reader->getColumns();
auto filterColumns = [&result, &columns](const IColumn::Filter & filter)
{
@ -528,7 +528,8 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
if (result.block.has(column.name))
{
auto & column_with_type_and_name = result.block.getByName(column.name);
column_with_type_and_name.column = std::move(column_with_type_and_name.column)->filter(filter, -1);
if (column_with_type_and_name.column)
column_with_type_and_name.column = column_with_type_and_name.column->filter(filter, -1);
}
}
};
@ -540,7 +541,7 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
auto & col = result.block.safeGetByPosition(i);
if (col.column && col.column->size() == filter.size())
col.column = std::move(col.column)->filter(filter, -1);
col.column = col.column->filter(filter, -1);
}
};
@ -557,7 +558,7 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
}
}
stream.reader()->fillMissingColumns(result.block, *ordered_names, always_reorder);
merge_tree_reader->fillMissingColumns(result.block, *ordered_names, always_reorder);
ColumnPtr filter;
if (prewhere_actions)

View File

@ -42,8 +42,6 @@ public:
bool isFinished() const { return is_finished; }
MergeTreeReader * reader() const { return merge_tree_reader; }
private:
size_t current_mark = 0;
size_t current_offset = 0;
@ -78,8 +76,6 @@ public:
size_t numRendingGranules() const { return last_mark - current_mark; }
size_t numPendingRows() const { return numRendingGranules() * index_granularity - offset_after_current_mark; }
MergeTreeReader * reader() const { return stream.reader(); }
private:
size_t current_mark = 0;
/// Invariant: offset_after_current_mark + skipped_rows_after_offset < index_granularity