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/07/06 02:21:26 UTC

[GitHub] [doris] englefly opened a new pull request, #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

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

   # Proposed changes
   1. add evaluate_and_vec() for ComparisonPredicateBase to avoid merging ret_flags when there are multiple vec_predicates.
   2. using ComparisonPrediate directly in SegmentIterator, instead of wrapping predicate inside a BlockColumnPredicate.
   
   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)
   4. Has unit tests been added: (Yes/No/No Need)
   5. Has document been added or modified: (Yes/No/No Need)
   6. Does it need to update dependencies: (Yes/No)
   7. 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] [doris] yiguolei commented on a diff in pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #10631:
URL: https://github.com/apache/doris/pull/10631#discussion_r914460680


##########
be/src/olap/rowset/segment_v2/segment_iterator.h:
##########
@@ -121,6 +121,19 @@ class SegmentIterator : public RowwiseIterator {
 
     bool _can_evaluated_by_vectorized(ColumnPredicate* predicate);
 
+    vectorized::MutableColumnPtr& _get_column_for_vec_predicate(int vec_pred_id) {

Review Comment:
   这里把_evaluate_short_circuit_predicate 也调用这个函数实现吧



-- 
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] github-actions[bot] commented on pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10631:
URL: https://github.com/apache/doris/pull/10631#issuecomment-1177187523

   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


[GitHub] [doris] github-actions[bot] commented on pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10631:
URL: https://github.com/apache/doris/pull/10631#issuecomment-1177187550

   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


[GitHub] [doris] yiguolei commented on a diff in pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #10631:
URL: https://github.com/apache/doris/pull/10631#discussion_r914459164


##########
be/src/olap/comparison_predicate.h:
##########
@@ -262,7 +263,71 @@ class ComparisonPredicateBase : public ColumnPredicate {
                                 ->get_data()
                                 .data();
 
-                _base_loop_vec<false>(size, flags, nullptr, data_array, _value_real);
+                _base_loop_vec<false, false>(size, flags, nullptr, data_array, _value_real);
+            }
+        }
+
+        if (_opposite) {
+            for (uint16_t i = 0; i < size; i++) {
+                flags[i] = !flags[i];
+            }
+        }
+    }
+
+    void evaluate_and_vec(const vectorized::IColumn& column, uint16_t size,

Review Comment:
   这个代码的逻辑大部分跟 evaluate_vec 一样,是不是直接搞一个通用的函数,然后evalue_and 和 evaluate_and_vec 掉一把就可以了



-- 
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 commented on a diff in pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

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


##########
be/src/olap/rowset/segment_v2/segment_iterator.h:
##########
@@ -121,6 +121,19 @@ class SegmentIterator : public RowwiseIterator {
 
     bool _can_evaluated_by_vectorized(ColumnPredicate* predicate);
 
+    vectorized::MutableColumnPtr& _get_column_for_vec_predicate(int vec_pred_id) {

Review Comment:
   我正准备改_evaluate_short_circuit_predicate。_evaluate_short_circuit_predicate 里面不需要这个逻辑了,因为字典已经走vec_predicate 了



-- 
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] yiguolei merged pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #10631:
URL: https://github.com/apache/doris/pull/10631


-- 
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 commented on a diff in pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

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


##########
be/src/olap/comparison_predicate.h:
##########
@@ -262,7 +263,71 @@ class ComparisonPredicateBase : public ColumnPredicate {
                                 ->get_data()
                                 .data();
 
-                _base_loop_vec<false>(size, flags, nullptr, data_array, _value_real);
+                _base_loop_vec<false, false>(size, flags, nullptr, data_array, _value_real);
+            }
+        }
+
+        if (_opposite) {
+            for (uint16_t i = 0; i < size; i++) {
+                flags[i] = !flags[i];
+            }
+        }
+    }
+
+    void evaluate_and_vec(const vectorized::IColumn& column, uint16_t size,

Review Comment:
   evaluate_and_vec  和 evaluate_vec 都是 virtual 函数,所以不能用模板。如果要用一个函数实现,就只能在函数里面 if-else 判断,影响了性能,所以分成了两个



-- 
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 commented on a diff in pull request #10631: [refactor] add evaluate_and_vec() for ComparisonPredicateBase

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


##########
be/src/olap/rowset/segment_v2/segment_iterator.h:
##########
@@ -121,6 +121,19 @@ class SegmentIterator : public RowwiseIterator {
 
     bool _can_evaluated_by_vectorized(ColumnPredicate* predicate);
 
+    vectorized::MutableColumnPtr& _get_column_for_vec_predicate(int vec_pred_id) {

Review Comment:
   调整了这个函数的实现



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