airborne12 commented on code in PR #28494:
URL: https://github.com/apache/doris/pull/28494#discussion_r1428712086


##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -2570,5 +2573,64 @@ void 
SegmentIterator::_calculate_pred_in_remaining_conjunct_root(
     }
 }
 
+bool SegmentIterator::_need_read_pk_data(ColumnId cid, 
vectorized::MutableColumnPtr& column,
+                                         size_t nrows_read) {
+    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 (!_opts.tablet_schema->column(cid).is_key()) {
+        return false;
+    }
+
+    // Whether the primary key index is an exact query
+    {
+        auto get_max_datetime_string = [](FieldType filed_type) {
+            std::string res;
+            if (filed_type == FieldType::OLAP_FIELD_TYPE_DATETIMEV2) {
+                auto max = 
type_limit<PrimitiveTypeTraits<TYPE_DATETIMEV2>::CppType>::max();
+                res.resize(30);
+                max.to_string(res.data());
+            } else if (filed_type == FieldType::OLAP_FIELD_TYPE_INT) {
+                auto max = 
type_limit<PrimitiveTypeTraits<TYPE_INT>::CppType>::max();
+                res = boost::lexical_cast<std::string>(max);
+            }
+            return res;

Review Comment:
   how about other type of field?



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