kangpinghuang commented on a change in pull request #2074: Add stats to 
BetaRowsetReader
URL: https://github.com/apache/incubator-doris/pull/2074#discussion_r339299632
 
 

 ##########
 File path: be/src/olap/rowset/beta_rowset_reader.cpp
 ##########
 @@ -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;
+    }
 
 Review comment:
   ```suggestion
      if (_context->stats != nullptr) {
          read_options.stats = _context->stats;
      }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to