BiteTheDDDDt commented on code in PR #13581:
URL: https://github.com/apache/doris/pull/13581#discussion_r1017520577


##########
be/src/olap/in_list_predicate.h:
##########
@@ -101,24 +102,78 @@ class InListPredicateBase : public ColumnPredicate {
             } else {
                 tmp = convert(condition);
             }
-            _values.insert(tmp);
-            if (tmp > _max_value) {
-                _max_value = tmp;
-            }
-            if (tmp < _min_value) {
-                _min_value = tmp;
+            _values->insert(tmp);
+            _update_min_max(tmp);
+        }
+    }
+
+    InListPredicateBase(uint32_t column_id, const 
std::shared_ptr<HybridSetBase>& hybrid_set,
+                        size_t char_length = 0)
+            : ColumnPredicate(column_id, false),
+              _min_value(type_limit<T>::max()),
+              _max_value(type_limit<T>::min()) {
+        using HybridSetType = std::conditional_t<is_string_type(Type), 
StringSet, HybridSet<Type>>;
+
+        CHECK(hybrid_set != nullptr);
+
+        if constexpr (is_string_type(Type) || Type == TYPE_DECIMALV2 || 
is_date_type(Type)) {
+            _values = new phmap::flat_hash_set<T>();
+            auto values = ((HybridSetType*)hybrid_set.get())->get_inner_set();
+
+            if constexpr (is_string_type(Type)) {
+                for (auto& value : *values) {
+                    StringValue sv = {value.data(), int(value.size())};
+                    if constexpr (Type == TYPE_CHAR) {
+                        _temp_datas.push_back("");
+                        _temp_datas.back().resize(std::max(char_length, 
value.size()));

Review Comment:
   https://cplusplus.com/reference/string/string/resize/ 
   `they are value-initialized characters.`  I think it means `char()`. 
   In other words, value-initialized characters is '\0'.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to