updated MergeTreePrewhereRangeReader; renamed MergeTreePrewhereRangeReader to MergeTreeRangeReader

This commit is contained in:
Nikolai Kochetov 2018-02-20 16:30:47 +03:00
parent 3063c35429
commit dcd99860fe
3 changed files with 8 additions and 7 deletions

View File

@ -147,8 +147,8 @@ Block MergeTreeBaseBlockInputStream::readFromPart()
if (task->size_predictor) if (task->size_predictor)
{ {
task->size_predictor->updateFilteredRowsRation( task->size_predictor->updateFilteredRowsRation(
read_result.getNumAddedRows() + read_result.getNumFilteredRows(), read_result.numAddedRows() + read_result.numFilteredRows(),
read_result.getNumFilteredRows()); read_result.numFilteredRows());
if (read_result.block) if (read_result.block)
task->size_predictor->update(read_result.block); task->size_predictor->update(read_result.block);

View File

@ -449,10 +449,11 @@ MergeTreeRangeReader::ReadResult MergeTreeRangeReader::startReadingChain(size_t
result.addRows(stream.finalize(result.block)); result.addRows(stream.finalize(result.block));
auto last_granule = result.rowsPerGranule().back(); auto last_granule = result.rowsPerGranule().back();
auto added_rows =result.getNumAddedRows(); auto added_rows = result.numAddedRows();
auto num_read_rows = result.numReadRows();
if (max_rows - last_granule > added_rows) if (num_read_rows - last_granule > added_rows)
throw Exception("RangeReader expected reading of at least " + toString(max_rows - last_granule) + throw Exception("RangeReader expected reading of at least " + toString(num_read_rows - last_granule) +
" rows, but only " + toString(added_rows) + " was read.", ErrorCodes::LOGICAL_ERROR); " rows, but only " + toString(added_rows) + " was read.", ErrorCodes::LOGICAL_ERROR);
/// Last granule may be incomplete. /// Last granule may be incomplete.

View File

@ -107,9 +107,9 @@ public:
/// The number of rows were read at LAST iteration in chain. <= num_added_rows + num_filtered_rows. /// The number of rows were read at LAST iteration in chain. <= num_added_rows + num_filtered_rows.
size_t numReadRows() const { return num_read_rows; } size_t numReadRows() const { return num_read_rows; }
/// The number of rows were added to block as a result of reading chain. /// The number of rows were added to block as a result of reading chain.
size_t getNumAddedRows() const { return num_added_rows; } size_t numAddedRows() const { return num_added_rows; }
/// The number of filtered rows at all steps in reading chain. /// The number of filtered rows at all steps in reading chain.
size_t getNumFilteredRows() const { return num_filtered_rows; } size_t numFilteredRows() const { return num_filtered_rows; }
/// Filter you need to apply to newly-read columns in order to add them to block. /// Filter you need to apply to newly-read columns in order to add them to block.
const ColumnPtr & getFilter() const { return filter; } const ColumnPtr & getFilter() const { return filter; }