[vectorized](pipeline) support assert num rows operator (#14923)

This commit is contained in:
zhangstar333
2022-12-09 09:39:29 +08:00
committed by GitHub
parent b311ebef6c
commit 20f2abb3d4
4 changed files with 70 additions and 10 deletions

View File

@ -18,8 +18,6 @@
#include "vec/exec/vassert_num_rows_node.h"
#include "gen_cpp/PlanNodes_types.h"
#include "gutil/strings/substitute.h"
#include "runtime/row_batch.h"
#include "runtime/runtime_state.h"
#include "util/runtime_profile.h"
#include "vec/core/block.h"
@ -47,12 +45,7 @@ Status VAssertNumRowsNode::open(RuntimeState* state) {
return Status::OK();
}
Status VAssertNumRowsNode::get_next(RuntimeState* state, Block* block, bool* eos) {
INIT_AND_SCOPE_GET_NEXT_SPAN(state->get_tracer(), _get_next_span,
"VAssertNumRowsNode::get_next");
SCOPED_TIMER(_runtime_profile->total_time_counter());
RETURN_IF_ERROR_AND_CHECK_SPAN(child(0)->get_next_after_projects(state, block, eos),
child(0)->get_next_span(), *eos);
Status VAssertNumRowsNode::pull(doris::RuntimeState* state, vectorized::Block* block, bool* eos) {
_num_rows_returned += block->rows();
bool assert_res = false;
switch (_assertion) {
@ -98,4 +91,14 @@ Status VAssertNumRowsNode::get_next(RuntimeState* state, Block* block, bool* eos
return Status::OK();
}
Status VAssertNumRowsNode::get_next(RuntimeState* state, Block* block, bool* eos) {
INIT_AND_SCOPE_GET_NEXT_SPAN(state->get_tracer(), _get_next_span,
"VAssertNumRowsNode::get_next");
SCOPED_TIMER(_runtime_profile->total_time_counter());
RETURN_IF_ERROR_AND_CHECK_SPAN(child(0)->get_next_after_projects(state, block, eos),
child(0)->get_next_span(), *eos);
return pull(state, block, eos);
}
} // namespace doris::vectorized