You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/13 10:31:50 UTC

[GitHub] [incubator-doris] englefly opened a new pull request, #10099: [Refactor] change the macro style of the InListPredicate

englefly opened a new pull request, #10099:
URL: https://github.com/apache/incubator-doris/pull/10099

   # Proposed changes
   refactor in_list_predicate.cpp
   1. use normal cpp code instead of macro definition.
   2. remvoe NotInListPredicate class. It is almost duplicated to InListPredicate
   3. add bool _in_or_not member in InListPredicate. if _in_or_not=false, InListPredicate stands for former NotInListPredicate.
   
   Only rewrite vectorization part. The non-vertorization parts are still in Macros style. remove them when we clean non-verctorization code.
   
   Issue Number: close #xxx
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   3. Has unit tests been added: (Yes/No/No Need)
   6. Has document been added or modified: (Yes/No/No Need)
   7. Does it need to update dependencies: (Yes/No)
   8. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## 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


[GitHub] [incubator-doris] englefly commented on a diff in pull request #10099: [Refactor] change the macro style of the InListPredicate

Posted by GitBox <gi...@apache.org>.
englefly commented on code in PR #10099:
URL: https://github.com/apache/incubator-doris/pull/10099#discussion_r895631456


##########
be/src/olap/in_list_predicate.h:
##########
@@ -76,33 +76,55 @@ namespace doris {
 class VectorizedRowBatch;
 
 // todo(wb) support evaluate_and,evaluate_or
+template <class T>
+class InListPredicate : public ColumnPredicate {
+public:
+    InListPredicate(uint32_t column_id, phmap::flat_hash_set<T>&& values, bool in_or_not, bool is_opposite = false);
+    PredicateType type() const override { return PredicateType::IN_LIST; }
+    virtual void evaluate(VectorizedRowBatch* batch) const override;
+    void evaluate(ColumnBlock* block, uint16_t* sel, uint16_t* size) const override;
+    void evaluate_or(ColumnBlock* block, uint16_t* sel, uint16_t size,
+                        bool* flags) const override;
+    void evaluate_and(ColumnBlock* block, uint16_t* sel, uint16_t size,
+                        bool* flags) const override;
+    virtual Status evaluate(const Schema& schema,
+                            const std::vector<BitmapIndexIterator*>& iterators,
+                            uint32_t num_rows, roaring::Roaring* bitmap) const override;
+    void evaluate(vectorized::IColumn& column, uint16_t* sel, uint16_t* size) const override;
+    void evaluate_and(vectorized::IColumn& column, uint16_t* sel, uint16_t size,
+                        bool* flags) const override {}
+    void evaluate_or(vectorized::IColumn& column, uint16_t* sel, uint16_t size,
+                        bool* flags) const override {}
+
+private:
+    phmap::flat_hash_set<T> _values;
+    bool _in_or_not; //true for in(...), false for not in (...)
+};
+
+// template <class T>

Review Comment:
   The NotInListPredicate definition is removed.



-- 
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


[GitHub] [incubator-doris] yiguolei commented on pull request #10099: [Refactor] change the macro style of the InListPredicate

Posted by GitBox <gi...@apache.org>.
yiguolei commented on PR #10099:
URL: https://github.com/apache/incubator-doris/pull/10099#issuecomment-1153761209

   very expected work....


-- 
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


[GitHub] [incubator-doris] BiteTheDDDDt commented on pull request #10099: [Refactor] change the macro style of the InListPredicate

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on PR #10099:
URL: https://github.com/apache/incubator-doris/pull/10099#issuecomment-1153762906

   Hi, I have done some similar work, maybe you can refer to some designs.
   https://github.com/BiteTheDDDDt/incubator-doris/commit/93bdd0582fd6c2890e6f36c1805755712e40553d#diff-1cfbfefc7969508323c47da436eeb1d5788b4ec905166f99b967c248974d9eb1


-- 
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


[GitHub] [doris] englefly closed pull request #10099: [Refactor] change the macro style of the InListPredicate

Posted by GitBox <gi...@apache.org>.
englefly closed pull request #10099: [Refactor] change the macro style of the InListPredicate 
URL: https://github.com/apache/doris/pull/10099


-- 
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


[GitHub] [incubator-doris] englefly commented on a diff in pull request #10099: [Refactor] change the macro style of the InListPredicate

Posted by GitBox <gi...@apache.org>.
englefly commented on code in PR #10099:
URL: https://github.com/apache/incubator-doris/pull/10099#discussion_r895580596


##########
be/src/olap/in_list_predicate.h:
##########
@@ -76,33 +76,55 @@ namespace doris {
 class VectorizedRowBatch;
 
 // todo(wb) support evaluate_and,evaluate_or
+template <class T>
+class InListPredicate : public ColumnPredicate {
+public:
+    InListPredicate(uint32_t column_id, phmap::flat_hash_set<T>&& values, bool in_or_not, bool is_opposite = false);
+    PredicateType type() const override { return PredicateType::IN_LIST; }
+    virtual void evaluate(VectorizedRowBatch* batch) const override;
+    void evaluate(ColumnBlock* block, uint16_t* sel, uint16_t* size) const override;
+    void evaluate_or(ColumnBlock* block, uint16_t* sel, uint16_t size,
+                        bool* flags) const override;
+    void evaluate_and(ColumnBlock* block, uint16_t* sel, uint16_t size,
+                        bool* flags) const override;
+    virtual Status evaluate(const Schema& schema,
+                            const std::vector<BitmapIndexIterator*>& iterators,
+                            uint32_t num_rows, roaring::Roaring* bitmap) const override;
+    void evaluate(vectorized::IColumn& column, uint16_t* sel, uint16_t* size) const override;
+    void evaluate_and(vectorized::IColumn& column, uint16_t* sel, uint16_t size,
+                        bool* flags) const override {}
+    void evaluate_or(vectorized::IColumn& column, uint16_t* sel, uint16_t size,
+                        bool* flags) const override {}
+
+private:
+    phmap::flat_hash_set<T> _values;
+    bool _in_or_not; //true for in(...), false for not in (...)
+};
+
+// template <class T>

Review Comment:
   It is better remove these codes when we clean non-vectorized code.



-- 
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


[GitHub] [incubator-doris] Gabriel39 commented on a diff in pull request #10099: [Refactor] change the macro style of the InListPredicate

Posted by GitBox <gi...@apache.org>.
Gabriel39 commented on code in PR #10099:
URL: https://github.com/apache/incubator-doris/pull/10099#discussion_r895570045


##########
be/src/olap/in_list_predicate.h:
##########
@@ -76,33 +76,55 @@ namespace doris {
 class VectorizedRowBatch;
 
 // todo(wb) support evaluate_and,evaluate_or
+template <class T>
+class InListPredicate : public ColumnPredicate {
+public:
+    InListPredicate(uint32_t column_id, phmap::flat_hash_set<T>&& values, bool in_or_not, bool is_opposite = false);
+    PredicateType type() const override { return PredicateType::IN_LIST; }
+    virtual void evaluate(VectorizedRowBatch* batch) const override;
+    void evaluate(ColumnBlock* block, uint16_t* sel, uint16_t* size) const override;
+    void evaluate_or(ColumnBlock* block, uint16_t* sel, uint16_t size,
+                        bool* flags) const override;
+    void evaluate_and(ColumnBlock* block, uint16_t* sel, uint16_t size,
+                        bool* flags) const override;
+    virtual Status evaluate(const Schema& schema,
+                            const std::vector<BitmapIndexIterator*>& iterators,
+                            uint32_t num_rows, roaring::Roaring* bitmap) const override;
+    void evaluate(vectorized::IColumn& column, uint16_t* sel, uint16_t* size) const override;
+    void evaluate_and(vectorized::IColumn& column, uint16_t* sel, uint16_t size,
+                        bool* flags) const override {}
+    void evaluate_or(vectorized::IColumn& column, uint16_t* sel, uint16_t size,
+                        bool* flags) const override {}
+
+private:
+    phmap::flat_hash_set<T> _values;
+    bool _in_or_not; //true for in(...), false for not in (...)
+};
+
+// template <class T>

Review Comment:
   delete these commented codes?



-- 
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