github-actions[bot] commented on code in PR #26081:
URL: https://github.com/apache/doris/pull/26081#discussion_r1403006343


##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -2422,5 +2445,139 @@ void 
SegmentIterator::_calculate_pred_in_remaining_conjunct_root(
     }
 }
 
+bool SegmentIterator::_is_all_invert_index_hit() {

Review Comment:
   warning: method '_is_all_invert_index_hit' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
   bool SegmentIterator::_is_all_invert_index_hit() const {
   ```
   
   be/src/olap/rowset/segment_v2/segment_iterator.h:329:
   ```diff
   -     bool _is_all_invert_index_hit();
   +     bool _is_all_invert_index_hit() const;
   ```
   



##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -2422,5 +2445,139 @@
     }
 }
 
+bool SegmentIterator::_is_all_invert_index_hit() {
+    if (_opts.tablet_schema->keys_type() != KeysType::DUP_KEYS) {
+        return false;
+    }
+
+    if (_opts.push_down_agg_type_opt != TPushAggOp::COUNT_ON_INDEX) {
+        return false;
+    }
+
+    if (_invert_index_hit_count == 0 || _all_predicate_count_ == 0) {
+        return false;
+    }
+
+    if (!_is_all_index_hit_opt) {
+        return false;
+    }
+
+    // The conditions all hit the inverted index
+    if (_invert_index_hit_count != _all_predicate_count_) {
+        return false;
+    }
+
+    return true;
+}
+
+bool SegmentIterator::_read_default_with_all_hit_opt(uint32_t cid,
+                                                     
vectorized::MutableColumnPtr& column,
+                                                     size_t nrows_read) {
+    if (!_opts.tablet_schema->column(cid).is_key()) {
+        return false;
+    }
+
+    if (!_is_all_invert_index_hit()) {
+        return false;
+    }
+
+    if (column->is_nullable()) {
+        auto* nullable_col_ptr = 
reinterpret_cast<vectorized::ColumnNullable*>(column.get());
+        
nullable_col_ptr->get_null_map_column().insert_many_defaults(nrows_read);
+        
nullable_col_ptr->get_nested_column_ptr()->insert_many_defaults(nrows_read);
+    } else {
+        column->insert_many_defaults(nrows_read);
+    }
+
+    return true;
+}
+
+bool SegmentIterator::check_all_index_hit_opt() {

Review Comment:
   warning: function 'check_all_index_hit_opt' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
   bool SegmentIterator::check_all_index_hit_opt() {
                         ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/segment_iterator.cpp:2494:** 85 lines 
including whitespace and comments (threshold 80)
   ```cpp
   bool SegmentIterator::check_all_index_hit_opt() {
                         ^
   ```
   
   </details>
   



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