Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions be/src/olap/in_list_predicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <cstdint>
#include <roaring/roaring.hh>

#include "common/compiler_util.h"
#include "common/exception.h"
#include "decimal12.h"
#include "exprs/hybrid_set.h"
Expand Down Expand Up @@ -259,10 +260,8 @@ class InListPredicateBase final : public ColumnPredicate {

bool camp_field(const vectorized::Field& min_field, const vectorized::Field& max_field) const {
if constexpr (PT == PredicateType::IN_LIST) {
return (Compare::less_equal(min_field.template get<Type>(), _max_value) &&
Compare::greater_equal(max_field.template get<Type>(), _min_value)) ||
(Compare::greater_equal(max_field.template get<Type>(), _min_value) &&
Compare::less_equal(min_field.template get<Type>(), _max_value));
return Compare::less_equal(min_field.template get<Type>(), _max_value) &&
Compare::greater_equal(max_field.template get<Type>(), _min_value);
} else {
return true;
}
Expand All @@ -271,18 +270,19 @@ class InListPredicateBase final : public ColumnPredicate {
bool evaluate_and(vectorized::ParquetPredicate::ColumnStat* statistic) const override {
bool result = true;
if ((*statistic->get_stat_func)(statistic, column_id())) {
vectorized::Field min_field;
vectorized::Field max_field;
if (statistic->is_all_null) {
result = false;
} else if (!vectorized::ParquetPredicate::parse_min_max_value(
statistic->col_schema, statistic->encoded_min_value,
statistic->encoded_max_value, *statistic->ctz, &min_field,
&max_field)
.ok()) [[unlikely]] {
result = true;
} else {
result = camp_field(min_field, max_field);
vectorized::Field min_field;
vectorized::Field max_field;
auto st = vectorized::ParquetPredicate::parse_min_max_value(
statistic->col_schema, statistic->encoded_min_value,
statistic->encoded_max_value, *statistic->ctz, &min_field, &max_field);
if (LIKELY(st.ok())) {
result = camp_field(min_field, max_field);
} else { // status is not ok, return true directly
result = true;
}
}
}

Expand Down
Loading