BiteTheDDDDt commented on code in PR #11985:
URL: https://github.com/apache/doris/pull/11985#discussion_r954746976
##########
be/src/olap/comparison_predicate.h:
##########
@@ -199,6 +201,101 @@ class ComparisonPredicateBase : public ColumnPredicate {
_evaluate_bit<true>(column, sel, size, flags);
}
+ bool evaluate_and(const std::pair<WrapperField*, WrapperField*>&
statistic) const override {
+ if (statistic.first == nullptr || statistic.second == nullptr) {
+ return true;
+ }
+ if (statistic.first->is_null()) {
+ return true;
+ }
+ if constexpr (PT == PredicateType::EQ) {
+ if constexpr (Type == TYPE_DATE) {
+ T tmp_min_uint32_value = 0;
+ memcpy((char*)(&tmp_min_uint32_value),
statistic.first->cell_ptr(),
+ sizeof(uint24_t));
+ T tmp_max_uint32_value = 0;
+ memcpy((char*)(&tmp_max_uint32_value),
statistic.second->cell_ptr(),
+ sizeof(uint24_t));
+ return tmp_min_uint32_value <= _value && tmp_max_uint32_value
>= _value;
+ } else if constexpr (std::is_same_v<T, StringValue>) {
+ auto min = reinterpret_cast<const
Slice*>(statistic.first->cell_ptr());
+ auto max = reinterpret_cast<const
Slice*>(statistic.second->cell_ptr());
Review Comment:
```cpp
struct Slice {
public:
char* data;
size_t size;
}
struct StringValue {
char* ptr;
size_t len;
}
```
Does we can use `reinterpret_cast` directly?
--
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]