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/07 14:14:00 UTC

[GitHub] [incubator-doris] Gabriel39 opened a new pull request, #10001: [Bug] runtime filter is not used as expected

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

   # Proposed changes
   
   Issue Number: close #10000 
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. 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] github-actions[bot] commented on pull request #10001: [Bug] runtime filter is not used as expected

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

   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] [incubator-doris] yiguolei merged pull request #10001: [Bug] runtime filter is not used as expected

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


-- 
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] github-actions[bot] commented on pull request #10001: [Bug] runtime filter is not used as expected

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

   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] [incubator-doris] BiteTheDDDDt commented on a diff in pull request #10001: [Bug] runtime filter is not used as expected

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


##########
be/src/exprs/runtime_filter.cpp:
##########
@@ -976,15 +984,14 @@ Status IRuntimeFilter::get_prepared_context(std::vector<ExprContext*>* push_expr
     DCHECK(is_consumer());
     std::lock_guard<std::mutex> guard(_inner_mutex);
 
-    if (!_push_down_ctxs.empty()) {
-        push_expr_ctxs->insert(push_expr_ctxs->end(), _push_down_ctxs.begin(),
-                               _push_down_ctxs.end());
-        return Status::OK();
+    if (_push_down_ctxs.empty()) {
+        RETURN_IF_ERROR(_wrapper->get_push_context(&_push_down_ctxs, _state, _probe_ctx));
+        RETURN_IF_ERROR(Expr::prepare(_push_down_ctxs, _state, desc, tracker));
+        RETURN_IF_ERROR(Expr::open(_push_down_ctxs, _state));

Review Comment:
   If there is no return here, will it cause `_push_down_ctxs` to be inserted twice?



-- 
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] HappenLee commented on a diff in pull request #10001: [Bug] runtime filter is not used as expected

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


##########
be/src/exprs/runtime_filter.cpp:
##########
@@ -976,15 +984,14 @@ Status IRuntimeFilter::get_prepared_context(std::vector<ExprContext*>* push_expr
     DCHECK(is_consumer());
     std::lock_guard<std::mutex> guard(_inner_mutex);
 
-    if (!_push_down_ctxs.empty()) {
-        push_expr_ctxs->insert(push_expr_ctxs->end(), _push_down_ctxs.begin(),
-                               _push_down_ctxs.end());
-        return Status::OK();
+    if (_push_down_ctxs.empty()) {
+        RETURN_IF_ERROR(_wrapper->get_push_context(&_push_down_ctxs, _state, _probe_ctx));
+        RETURN_IF_ERROR(Expr::prepare(_push_down_ctxs, _state, desc, tracker));
+        RETURN_IF_ERROR(Expr::open(_push_down_ctxs, _state));

Review Comment:
   look like only `insert` in 993 line ?



-- 
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 a diff in pull request #10001: [Bug] runtime filter is not used as expected

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


##########
be/src/exprs/runtime_filter.cpp:
##########
@@ -976,15 +984,14 @@ Status IRuntimeFilter::get_prepared_context(std::vector<ExprContext*>* push_expr
     DCHECK(is_consumer());
     std::lock_guard<std::mutex> guard(_inner_mutex);
 
-    if (!_push_down_ctxs.empty()) {
-        push_expr_ctxs->insert(push_expr_ctxs->end(), _push_down_ctxs.begin(),
-                               _push_down_ctxs.end());
-        return Status::OK();
+    if (_push_down_ctxs.empty()) {
+        RETURN_IF_ERROR(_wrapper->get_push_context(&_push_down_ctxs, _state, _probe_ctx));
+        RETURN_IF_ERROR(Expr::prepare(_push_down_ctxs, _state, desc, tracker));
+        RETURN_IF_ERROR(Expr::open(_push_down_ctxs, _state));

Review Comment:
   > look like only `insert` in 993 line ?
   
   Yes, looks like the original code has a bug



-- 
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] HappenLee commented on a diff in pull request #10001: [Bug] runtime filter is not used as expected

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


##########
be/src/exec/olap_scan_node.cpp:
##########
@@ -1566,7 +1566,7 @@ void OlapScanNode::scanner_thread(OlapScanner* scanner) {
     auto& scanner_filter_apply_marks = *scanner->mutable_runtime_filter_marks();
     DCHECK(scanner_filter_apply_marks.size() == _runtime_filter_descs.size());
     for (size_t i = 0; i < scanner_filter_apply_marks.size(); i++) {
-        if (!scanner_filter_apply_marks[i] && !_runtime_filter_ctxs[i].apply_mark) {

Review Comment:
   should keep the  `!_runtime_filter_ctxs[i].apply_mark`.
   because if `runtime filter` come before 1s, the `apply_mark` is `true`, we do not need dispose the `runtime filter` already push down



-- 
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 #10001: [Bug] runtime filter is not used as expected

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


##########
be/src/exec/olap_scan_node.cpp:
##########
@@ -1566,7 +1566,7 @@ void OlapScanNode::scanner_thread(OlapScanner* scanner) {
     auto& scanner_filter_apply_marks = *scanner->mutable_runtime_filter_marks();
     DCHECK(scanner_filter_apply_marks.size() == _runtime_filter_descs.size());
     for (size_t i = 0; i < scanner_filter_apply_marks.size(); i++) {
-        if (!scanner_filter_apply_marks[i] && !_runtime_filter_ctxs[i].apply_mark) {

Review Comment:
   done



##########
be/src/exprs/runtime_filter.cpp:
##########
@@ -976,15 +984,14 @@ Status IRuntimeFilter::get_prepared_context(std::vector<ExprContext*>* push_expr
     DCHECK(is_consumer());
     std::lock_guard<std::mutex> guard(_inner_mutex);
 
-    if (!_push_down_ctxs.empty()) {
-        push_expr_ctxs->insert(push_expr_ctxs->end(), _push_down_ctxs.begin(),
-                               _push_down_ctxs.end());
-        return Status::OK();
+    if (_push_down_ctxs.empty()) {
+        RETURN_IF_ERROR(_wrapper->get_push_context(&_push_down_ctxs, _state, _probe_ctx));
+        RETURN_IF_ERROR(Expr::prepare(_push_down_ctxs, _state, desc, tracker));
+        RETURN_IF_ERROR(Expr::open(_push_down_ctxs, _state));

Review Comment:
   `_push_down_ctxs` will be only inserted once for each scanner.



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