yiguolei commented on code in PR #10016:
URL: https://github.com/apache/incubator-doris/pull/10016#discussion_r892256439


##########
be/src/olap/rowset/segment_v2/column_reader.cpp:
##########
@@ -679,22 +702,29 @@ Status FileColumnIterator::_read_data_page(const 
OrdinalPageIndexIterator& iter)
                 Slice dict_data;
                 PageFooterPB dict_footer;
                 _opts.type = INDEX_PAGE;
+                _dict_page_handle = std::make_shared<PageHandle>();

Review Comment:
   这里如果不改动,那么相当于每个iterator 会读取一次dict page,然后生成新的word info 与 dict decoder, 
这个代价很低,但是我们的代码结构会很简单,我觉得这次先可以采取这个策略。



##########
be/src/olap/rowset/segment_v2/binary_dict_page.cpp:
##########
@@ -313,5 +315,23 @@ Status BinaryDictPageDecoder::next_batch(size_t* n, 
ColumnBlockView* dst) {
     return Status::OK();
 }
 
+BinaryDictPageDecoder* BinaryDictPageDecoder::clone_for_cache() const {
+    BinaryDictPageDecoder* new_one = new BinaryDictPageDecoder(_data, 
_options);
+    new_one->_parsed = true;
+    new_one->_encoding_type = _encoding_type;
+    if (_encoding_type == DICT_ENCODING) {
+        DCHECK(_bit_shuffle_ptr != nullptr);
+        ColumnVectorBatch::create(0, false, 
get_scalar_type_info<OLAP_FIELD_TYPE_INT>(), nullptr,

Review Comment:
   _batch is only used in non-vec engine, I think we could ignore it. And we 
could add a check in column_reader only open parsed page cache during 
vec-engine.



##########
be/src/olap/rowset/segment_v2/page_decoder.h:
##########
@@ -102,6 +102,8 @@ class PageDecoder {
 
     bool has_remaining() const { return current_index() < count(); }
 
+    virtual PageDecoder* clone_for_cache() const = 0;

Review Comment:
   可能 unreachable 是不对的,他只是一个hint, 我觉得我们得直接 LOG(FATAL)



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

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to