This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 3b7a04ee8b [fix](inpredicate)always use PredicateColumn<TYPE_STRING>
for CHAR, VARCHAR and STRING type (#12637)
3b7a04ee8b is described below
commit 3b7a04ee8b61033618aaafd6262f5d70e2029187
Author: starocean999 <[email protected]>
AuthorDate: Mon Sep 19 08:37:06 2022 +0800
[fix](inpredicate)always use PredicateColumn<TYPE_STRING> for CHAR, VARCHAR
and STRING type (#12637)
The predicate column type for char, varchar and string is
PredicateColumnType<TYPE_STRING>, so _base_evaluate method should convert the
input column to PredicateColumnType<TYPE_STRING> always.
---
be/src/olap/comparison_predicate.h | 7 ++++++-
be/src/olap/in_list_predicate.h | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/be/src/olap/comparison_predicate.h
b/be/src/olap/comparison_predicate.h
index d05c847e2c..6fcb45bd3c 100644
--- a/be/src/olap/comparison_predicate.h
+++ b/be/src/olap/comparison_predicate.h
@@ -552,7 +552,8 @@ private:
}
} else {
auto* data_array =
-
vectorized::check_and_get_column<vectorized::PredicateColumnType<Type>>(column)
+
vectorized::check_and_get_column<vectorized::PredicateColumnType<EvalType>>(
+ column)
->get_data()
.data();
@@ -561,6 +562,10 @@ private:
}
T _value;
+ static constexpr PrimitiveType EvalType = (Type == TYPE_CHAR ? TYPE_STRING
: Type);
};
+template <PrimitiveType Type, PredicateType PT>
+constexpr PrimitiveType ComparisonPredicateBase<Type, PT>::EvalType;
+
} //namespace doris
diff --git a/be/src/olap/in_list_predicate.h b/be/src/olap/in_list_predicate.h
index 87acd34683..b0b9fc5330 100644
--- a/be/src/olap/in_list_predicate.h
+++ b/be/src/olap/in_list_predicate.h
@@ -375,7 +375,8 @@ private:
}
} else {
auto* nested_col_ptr =
-
vectorized::check_and_get_column<vectorized::PredicateColumnType<Type>>(column);
+
vectorized::check_and_get_column<vectorized::PredicateColumnType<EvalType>>(
+ column);
auto& data_array = nested_col_ptr->get_data();
for (uint16_t i = 0; i < size; i++) {
@@ -410,6 +411,10 @@ private:
mutable std::vector<vectorized::UInt8> _value_in_dict_flags;
T _min_value;
T _max_value;
+ static constexpr PrimitiveType EvalType = (Type == TYPE_CHAR ? TYPE_STRING
: Type);
};
+template <PrimitiveType Type, PredicateType PT>
+constexpr PrimitiveType InListPredicateBase<Type, PT>::EvalType;
+
} //namespace doris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]