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/05/12 03:03:34 UTC

[GitHub] [incubator-doris] HappenLee commented on a diff in pull request #9508: [Refactor] add vpre_filter_expr for vectorized to improve performance

HappenLee commented on code in PR #9508:
URL: https://github.com/apache/incubator-doris/pull/9508#discussion_r870907236


##########
be/src/exec/base_scanner.cpp:
##########
@@ -279,6 +286,54 @@ Status BaseScanner::_fill_dest_tuple(Tuple* dest_tuple, MemPool* mem_pool) {
     return Status::OK();
 }
 
+Status BaseScanner::filter_block(vectorized::Block* input_block, int slot_num) {
+    auto old_rows = input_block->rows();
+    RETURN_IF_ERROR(
+            vectorized::VExprContext::filter_block(_vpre_filter_ctx_ptr, input_block, slot_num));
+    _counter->num_rows_unselected += old_rows - input_block->rows();
+    return Status::OK();
+}
+
+Status BaseScanner::execute_exprs(vectorized::Block* output_block, vectorized::Block* input_block) {
+    // Do vectorized expr here
+    Status status;
+    if (!_dest_vexpr_ctx.empty()) {
+        *output_block = vectorized::VExprContext::get_output_block_after_execute_exprs(
+                _dest_vexpr_ctx, *input_block, status);
+        if (UNLIKELY(output_block->rows() == 0)) {
+            _success = false;
+            return status;
+        }
+    }
+
+    return Status::OK();
+}
+
+Status BaseScanner::fill_dest_block(vectorized::Block* dest_block,
+                                    std::vector<vectorized::MutableColumnPtr>& columns) {
+    if (columns.empty() || columns[0]->size() == 0) {
+        return Status::OK();
+    }
+
+    std::unique_ptr<vectorized::Block> temp_block(new vectorized::Block());

Review Comment:
   use stack blockļ¼Œ not smart ptr



##########
gensrc/thrift/PlanNodes.thrift:
##########
@@ -253,6 +253,7 @@ struct TBrokerScanNode {
     2: optional list<Exprs.TExpr> partition_exprs
     3: optional list<Partitions.TRangePartition> partition_infos
 	4: optional list<Exprs.TExpr> pre_filter_exprs

Review Comment:
   code format



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