chaoyli commented on a change in pull request #764: Convert next_row interface 
to next_block
URL: https://github.com/apache/incubator-doris/pull/764#discussion_r267302911
 
 

 ##########
 File path: be/src/olap/rowset/alpha_rowset_reader.cpp
 ##########
 @@ -136,42 +121,82 @@ int64_t AlphaRowsetReader::filtered_rows() {
     return _stats->rows_del_filtered;
 }
 
-OLAPStatus AlphaRowsetReader::_get_next_block(size_t pos, RowBlock** 
row_block) {
-    // get next block
-    OLAPStatus status = _column_datas[pos]->get_next_block(row_block);
-    if (status == OLAP_ERR_DATA_EOF && _key_range_size > 0) {
-        // reach the end of one predicate
-        // currently, SegmentReader can only support filter one key range a 
time
-        // refresh the predicate and continue read
-        _key_range_indices[pos]++;
-        OLAPStatus status = OLAP_SUCCESS;
-        while (_key_range_indices[pos] < _key_range_size) {
-            status = _column_datas[pos]->prepare_block_read(
-                    
_current_read_context->lower_bound_keys->at(_key_range_indices[pos]),
-                    
_current_read_context->is_lower_keys_included->at(_key_range_indices[pos]),
-                    
_current_read_context->upper_bound_keys->at(_key_range_indices[pos]),
-                    
_current_read_context->is_upper_keys_included->at(_key_range_indices[pos]),
-                    row_block);
-            if (status == OLAP_ERR_DATA_EOF) {
-                _key_range_indices[pos]++;
-                continue;
-            } else if (status != OLAP_SUCCESS) {
-                LOG(WARNING) << "prepare block read failed";
-                return status;
-            } else {
-                break;
-            }
+OLAPStatus AlphaRowsetReader::_next_block_for_cumulative_rowset(RowBlock** 
block) {
+    size_t pos = 0;
+    if (UNLIKELY(_row_blocks.empty() || _row_blocks[pos] == nullptr)) {
+        return OLAP_ERR_DATA_EOF;
+    }
+    OLAPStatus status = OLAP_SUCCESS;
+    if (_row_blocks[pos]->has_remaining()) {
+        *block = _row_blocks[pos];
+    } else {
+        RETURN_NOT_OK(_next_block_for_column_data(pos, &_row_blocks[pos]));
+        *block = _row_blocks[pos];
+    }
+    return status;
+}
+
+OLAPStatus 
AlphaRowsetReader::_next_block_for_singleton_without_merge(RowBlock** block) {
 
 Review comment:
   For singleton rowset, there may be many segment groups.
   Upon initialization, many rowblocks will be read in advance.
   So there is necessary to construct a std::vector<RowBlock> _row_blocks to 
store it.
   If segment groups size is one, the size of std::vector<RowBlock> _row_blocks 
will to equal one.
   Under this circumstance, and probably this circumstance dominates 
_next_block_for_cumulative_rowset will be the same with 
_next_block_for_singleton_without_merge.

----------------------------------------------------------------
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