Add stats to BetaRowsetReader (#2074)

This commit is contained in:
lichaoyong
2019-10-27 12:06:39 +08:00
committed by ZHAO Chun
parent 1859819aa7
commit 13fde9fce3
2 changed files with 10 additions and 1 deletions

View File

@ -38,7 +38,14 @@ OLAPStatus BetaRowsetReader::init(RowsetReaderContext* read_context) {
// convert RowsetReaderContext to StorageReadOptions
StorageReadOptions read_options;
read_options.stats = _context->stats;
if (_context->stats == nullptr) {
// schema change/compaction should use owned_stats
// When doing schema change/compaction,
// only statistics of this RowsetReader is necessary.
read_options.stats = &_owned_stats;
} else {
read_options.stats = _context->stats;
}
read_options.conditions = read_context->conditions;
if (read_context->lower_bound_keys != nullptr) {
for (int i = 0; i < read_context->lower_bound_keys->size(); ++i) {

View File

@ -53,6 +53,8 @@ private:
BetaRowsetSharedPtr _rowset;
RowsetReaderContext* _context;
OlapReaderStatistics _owned_stats;
std::unique_ptr<RowwiseIterator> _iterator;
std::unique_ptr<RowBlockV2> _input_block;