kangpinghuang 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_r267605249
##########
File path: be/src/olap/rowset/alpha_rowset_reader.cpp
##########
@@ -136,42 +121,83 @@ 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) {
+ // If tablet is a duplicate key tablet, there is no necessity to merge.
+ // If preaggregation is set to be false, there is no necessity to merge.
Review comment:
I think this comment is opposed to the logic of line 69. pls make the use of
preaggregation more clear.
It is necessary to add a clear comment to describe when preaggregation is
set to true or false?
----------------------------------------------------------------
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]