You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zhangstar333 (via GitHub)" <gi...@apache.org> on 2023/10/11 06:22:24 UTC

[PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

zhangstar333 opened a new pull request, #25290:
URL: https://github.com/apache/doris/pull/25290

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757484080

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 45.67 seconds
    stream load tsv:          560 seconds loaded 74807831229 Bytes, about 127 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          64 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          29.2 seconds inserted 10000000 Rows, about 342K ops/s
    storage size: 17161978679 Bytes


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759030371

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757632711

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757148272

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757205925

   TeamCity be ut coverage result:
    Function Coverage: 36.24% (8149/22487) 
    Line Coverage: 28.34% (65167/229922)
    Region Coverage: 27.27% (33765/123812)
    Branch Coverage: 23.96% (17206/71804)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/0397ac31af4501d8230fa0fcaf897dff01f07925_0397ac31af4501d8230fa0fcaf897dff01f07925/report/index.html


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757698359

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 45.77 seconds
    stream load tsv:          561 seconds loaded 74807831229 Bytes, about 127 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          64 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          29.3 seconds inserted 10000000 Rows, about 341K ops/s
    storage size: 17162339690 Bytes


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759018158

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759200151

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759016991

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757458807

   TeamCity be ut coverage result:
    Function Coverage: 36.24% (8149/22487) 
    Line Coverage: 28.34% (65162/229936)
    Region Coverage: 27.27% (33766/123840)
    Branch Coverage: 23.96% (17208/71812)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/0397ac31af4501d8230fa0fcaf897dff01f07925_0397ac31af4501d8230fa0fcaf897dff01f07925/report/index.html


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759105080

   TeamCity be ut coverage result:
    Function Coverage: 36.24% (8156/22508) 
    Line Coverage: 28.33% (65301/230469)
    Region Coverage: 27.05% (33821/125021)
    Branch Coverage: 23.87% (17256/72294)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/63ced46bae6d3481c22442e04ff6dcbfe360ad9e_63ced46bae6d3481c22442e04ff6dcbfe360ad9e/report/index.html


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757673409

   TeamCity be ut coverage result:
    Function Coverage: 36.23% (8151/22498) 
    Line Coverage: 28.35% (65198/230014)
    Region Coverage: 27.27% (33785/123906)
    Branch Coverage: 23.97% (17219/71828)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/49fbb56ac71ef791e2b5070fa46d93bf3aeffb13_49fbb56ac71ef791e2b5070fa46d93bf3aeffb13/report/index.html


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "HappenLee (via GitHub)" <gi...@apache.org>.
HappenLee commented on code in PR #25290:
URL: https://github.com/apache/doris/pull/25290#discussion_r1356015097


##########
be/src/exprs/minmax_predicate.h:
##########
@@ -128,11 +128,158 @@ class MinMaxNumFunc : public MinMaxFuncBase {
         return Status::OK();
     }
 
-private:
+protected:
     T _max = type_limit<T>::min();
     T _min = type_limit<T>::max();
     // we use _empty to avoid compare twice
     bool _empty = true;
 };
 
+template <class T>
+class MinNumFunc : public MinMaxNumFunc<T> {
+public:
+    MinNumFunc() = default;
+    ~MinNumFunc() override = default;
+
+    void insert(const void* data) override {
+        if (data == nullptr) {
+            return;
+        }
+
+        T val_data = *reinterpret_cast<const T*>(data);
+
+        if (this->_empty) {
+            this->_min = val_data;
+            this->_empty = false;
+            return;
+        }
+        if (val_data < this->_min) {
+            this->_min = val_data;
+        }
+    }
+
+    void insert_fixed_len(const char* data, const int* offsets, int number) override {
+        if (!number) {
+            return;
+        }
+        if (this->_empty) {
+            this->_min = *((T*)data + offsets[0]);
+        }
+        for (int i = this->_empty; i < number; i++) {
+            this->_min = std::min(this->_min, *((T*)data + offsets[i]));
+        }
+        this->_empty = false;
+    }
+
+    bool find(void* data) override {
+        if (data == nullptr) {
+            return false;
+        }
+
+        T val_data = *reinterpret_cast<T*>(data);
+        return val_data >= this->_min;
+    }
+
+    Status merge(MinMaxFuncBase* minmax_func, ObjectPool* pool) override {
+        if constexpr (std::is_same_v<T, StringRef>) {
+            MinNumFunc<T>* other_minmax = static_cast<MinNumFunc<T>*>(minmax_func);
+            if (other_minmax->_min < this->_min) {
+                auto& other_min = other_minmax->_min;
+                auto str = pool->add(new std::string(other_min.data, other_min.size));
+                this->_min.data = str->data();
+                this->_min.size = str->length();
+            }
+        } else {
+            MinNumFunc<T>* other_minmax = static_cast<MinNumFunc<T>*>(minmax_func);
+            if (other_minmax->_min < this->_min) {
+                this->_min = other_minmax->_min;
+            }
+        }
+
+        return Status::OK();
+    }
+
+    //min filter the max is useless, so return nullptr directly
+    void* get_max() override { return nullptr; }
+
+    Status assign(void* min_data, void* max_data) override {
+        this->_min = *(T*)min_data;
+        return Status::OK();
+    }
+};
+
+template <class T>
+class MaxNumFunc : public MinMaxNumFunc<T> {
+public:
+    MaxNumFunc() = default;
+    ~MaxNumFunc() override = default;
+
+    void insert(const void* data) override {
+        if (data == nullptr) {
+            return;
+        }
+
+        T val_data = *reinterpret_cast<const T*>(data);
+
+        if (this->_empty) {
+            this->_max = val_data;
+            this->_empty = false;
+            return;
+        }
+        if (val_data > this->_max) {
+            this->_max = val_data;
+        }
+    }
+
+    void insert_fixed_len(const char* data, const int* offsets, int number) override {
+        if (!number) {
+            return;
+        }
+        if (this->_empty) {
+            this->_max = *((T*)data + offsets[0]);
+        }
+        for (int i = this->_empty; i < number; i++) {
+            this->_max = std::max(this->_max, *((T*)data + offsets[i]));
+        }
+        this->_empty = false;
+    }
+
+    bool find(void* data) override {
+        if (data == nullptr) {
+            return false;
+        }
+
+        T val_data = *reinterpret_cast<T*>(data);
+        return val_data <= this->_max;
+    }
+
+    Status merge(MinMaxFuncBase* minmax_func, ObjectPool* pool) override {
+        if constexpr (std::is_same_v<T, StringRef>) {
+            MinMaxNumFunc<T>* other_minmax = static_cast<MinMaxNumFunc<T>*>(minmax_func);

Review Comment:
   assert_cast to  MaxNumFunc<T>*



-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1756955215

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757410742

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757655569

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 merged PR #25290:
URL: https://github.com/apache/doris/pull/25290


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1757244606

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.84 seconds
    stream load tsv:          554 seconds loaded 74807831229 Bytes, about 128 MB/s
    stream load json:         21 seconds loaded 2358488459 Bytes, about 107 MB/s
    stream load orc:          64 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          29.0 seconds inserted 10000000 Rows, about 344K ops/s
    storage size: 17162051221 Bytes


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "HappenLee (via GitHub)" <gi...@apache.org>.
HappenLee commented on code in PR #25290:
URL: https://github.com/apache/doris/pull/25290#discussion_r1356014193


##########
be/src/exprs/minmax_predicate.h:
##########
@@ -128,11 +128,158 @@ class MinMaxNumFunc : public MinMaxFuncBase {
         return Status::OK();
     }
 
-private:
+protected:
     T _max = type_limit<T>::min();
     T _min = type_limit<T>::max();
     // we use _empty to avoid compare twice
     bool _empty = true;
 };
 
+template <class T>
+class MinNumFunc : public MinMaxNumFunc<T> {
+public:
+    MinNumFunc() = default;
+    ~MinNumFunc() override = default;
+
+    void insert(const void* data) override {
+        if (data == nullptr) {
+            return;
+        }
+
+        T val_data = *reinterpret_cast<const T*>(data);
+
+        if (this->_empty) {
+            this->_min = val_data;
+            this->_empty = false;
+            return;
+        }
+        if (val_data < this->_min) {
+            this->_min = val_data;
+        }
+    }
+
+    void insert_fixed_len(const char* data, const int* offsets, int number) override {
+        if (!number) {
+            return;
+        }
+        if (this->_empty) {
+            this->_min = *((T*)data + offsets[0]);
+        }
+        for (int i = this->_empty; i < number; i++) {
+            this->_min = std::min(this->_min, *((T*)data + offsets[i]));
+        }
+        this->_empty = false;
+    }
+
+    bool find(void* data) override {
+        if (data == nullptr) {
+            return false;
+        }
+
+        T val_data = *reinterpret_cast<T*>(data);
+        return val_data >= this->_min;
+    }
+
+    Status merge(MinMaxFuncBase* minmax_func, ObjectPool* pool) override {
+        if constexpr (std::is_same_v<T, StringRef>) {
+            MinNumFunc<T>* other_minmax = static_cast<MinNumFunc<T>*>(minmax_func);
+            if (other_minmax->_min < this->_min) {
+                auto& other_min = other_minmax->_min;
+                auto str = pool->add(new std::string(other_min.data, other_min.size));
+                this->_min.data = str->data();
+                this->_min.size = str->length();
+            }
+        } else {
+            MinNumFunc<T>* other_minmax = static_cast<MinNumFunc<T>*>(minmax_func);
+            if (other_minmax->_min < this->_min) {
+                this->_min = other_minmax->_min;
+            }
+        }
+
+        return Status::OK();
+    }
+
+    //min filter the max is useless, so return nullptr directly
+    void* get_max() override { return nullptr; }
+
+    Status assign(void* min_data, void* max_data) override {
+        this->_min = *(T*)min_data;
+        return Status::OK();
+    }
+};
+
+template <class T>
+class MaxNumFunc : public MinMaxNumFunc<T> {
+public:
+    MaxNumFunc() = default;
+    ~MaxNumFunc() override = default;
+
+    void insert(const void* data) override {
+        if (data == nullptr) {
+            return;
+        }
+
+        T val_data = *reinterpret_cast<const T*>(data);
+
+        if (this->_empty) {
+            this->_max = val_data;
+            this->_empty = false;
+            return;
+        }
+        if (val_data > this->_max) {
+            this->_max = val_data;
+        }
+    }
+
+    void insert_fixed_len(const char* data, const int* offsets, int number) override {
+        if (!number) {
+            return;
+        }
+        if (this->_empty) {
+            this->_max = *((T*)data + offsets[0]);
+        }
+        for (int i = this->_empty; i < number; i++) {
+            this->_max = std::max(this->_max, *((T*)data + offsets[i]));
+        }
+        this->_empty = false;
+    }
+
+    bool find(void* data) override {
+        if (data == nullptr) {
+            return false;
+        }
+
+        T val_data = *reinterpret_cast<T*>(data);
+        return val_data <= this->_max;
+    }
+
+    Status merge(MinMaxFuncBase* minmax_func, ObjectPool* pool) override {
+        if constexpr (std::is_same_v<T, StringRef>) {
+            MinMaxNumFunc<T>* other_minmax = static_cast<MinMaxNumFunc<T>*>(minmax_func);
+
+            if (other_minmax->_max > this->_max) {
+                auto& other_max = other_minmax->_max;
+                auto str = pool->add(new std::string(other_max.data, other_max.size));
+                this->_max.data = str->data();
+                this->_max.size = str->length();
+            }
+        } else {
+            MinMaxNumFunc<T>* other_minmax = static_cast<MinMaxNumFunc<T>*>(minmax_func);
+            if (other_minmax->_max > this->_max) {
+                this->_max = other_minmax->_max;
+            }
+        }
+
+        return Status::OK();
+    }
+
+    //max filter the min is useless, so return nullptr directly
+    void* get_min() override { return nullptr; }

Review Comment:
   better DCHECK(false) core here, not return nullptr



-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759094898

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 45.15 seconds
    stream load tsv:          563 seconds loaded 74807831229 Bytes, about 126 MB/s
    stream load json:         21 seconds loaded 2358488459 Bytes, about 107 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.9 seconds inserted 10000000 Rows, about 346K ops/s
    storage size: 17162349083 Bytes


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [Enhancement](filter) support only min/max runtime filter in BE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25290:
URL: https://github.com/apache/doris/pull/25290#issuecomment-1759200059

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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