imay 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_r266929641
##########
File path: be/src/olap/rowset/alpha_rowset_reader.cpp
##########
@@ -54,66 +48,57 @@ OLAPStatus AlphaRowsetReader::init(RowsetReaderContext*
read_context) {
_dst_cursor = new(std::nothrow)RowCursor();
_dst_cursor->init(*(_current_read_context->tablet_schema));
OLAPStatus status = _init_column_datas(read_context);
- return status;
-}
-bool AlphaRowsetReader::has_next() {
- bool next_flag = false;
- for (int i = 0; i < _column_datas.size(); ++i) {
- auto& row_block = _row_blocks[i];
- if (row_block != nullptr) {
- if (row_block->has_remaining()) {
- next_flag = true;
+ Version version = _alpha_rowset_meta->version();
+ _is_singleton_rowset = (version.first == version.second);
+ bool merge = false;
+ /*
+ * For singleton rowset, there exists three situations.
+ * 1. DUP_KEYS tablet has no necessities to merge row in advance.
+ * 2. COMPACTION/CHECKSUM/ALTER_TABLET task has no necessities to
+ * merge row in advance.
+ * 3. QUERY task will set preaggregation. If preaggregation is
+ * set to be true, it is necessary to merge row in advance.
+ * For cumulative rowset, there is no necessities to merge row in advance.
+ */
+ if (_is_singleton_rowset) {
+ if (_current_read_context->tablet_schema->keys_type() == DUP_KEYS) {
+ // DUP_KEYS tablet
+ _next_block =
&AlphaRowsetReader::_next_block_for_singleton_without_merge;
+ } else {
+ if (_current_read_context->reader_type == READER_QUERY
+ && _current_read_context->preaggregation) {
+ // QUERY task which set preaggregation to be true.
+ _next_block =
&AlphaRowsetReader::_next_block_for_singleton_with_merge;
Review comment:
when `preaggregation` is set to true, we read data 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]