HappenLee commented on code in PR #59263:
URL: https://github.com/apache/doris/pull/59263#discussion_r3316349523


##########
be/src/storage/segment/column_reader.h:
##########
@@ -424,18 +426,82 @@ class ColumnIterator {
     bool read_offset_only() const { return _read_mode == 
ReadMode::OFFSET_ONLY; }
     bool read_null_map_only() const { return _read_mode == 
ReadMode::NULL_MAP_ONLY; }
 
+    enum class ReadingMode : int {
+        NORMAL, // default mode
+        PREDICATE,
+        LAZY
+    };
+
+    virtual void set_reading_mode(ReadingMode mode) {
+        _reading_mode = mode;
+        if (mode == ReadingMode::PREDICATE) {
+            _has_place_holder_column = false;
+        }
+    }
+
+    virtual bool need_to_read() const {
+        switch (_reading_mode) {
+        case ReadingMode::NORMAL:
+            return _reading_flag != ReadingFlag::SKIP_READING;
+        case ReadingMode::PREDICATE:
+            return _reading_flag == ReadingFlag::READING_FOR_PREDICATE;
+        case ReadingMode::LAZY:
+            return _reading_flag == ReadingFlag::NEED_TO_READ;
+        default:
+            return false;
+        }
+    }
+
+    // Whether need to read meta columns, such as null map column, offset 
column.
+    bool need_to_read_meta_columns() const {
+        if (_reading_flag == ReadingFlag::SKIP_READING) {
+            return false;
+        }
+        switch (_reading_mode) {
+        case ReadingMode::NORMAL:
+        case ReadingMode::PREDICATE:
+            return true;
+        case ReadingMode::LAZY:
+            return _reading_flag != ReadingFlag::READING_FOR_PREDICATE;
+        }
+        return false;
+    }
+
+    virtual void finalize_lazy_mode(MutableColumnPtr& dst) {
+        _recovery_from_place_holder_column(dst);
+    }
+
+    virtual void set_reading_flag_recursively(ReadingFlag flag) { 
set_reading_flag(flag); }

Review Comment:
   这个命名应该跟reading mode一样,感觉怎么一个带递归名字,另外一个不带呢



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to