[enhancement] Refactor to improve the usability of MemTracker (step2) (#10823)
This commit is contained in:
@ -90,11 +90,11 @@ bool TableFunctionNode::_is_inner_and_empty() {
|
||||
|
||||
Status TableFunctionNode::prepare(RuntimeState* state) {
|
||||
RETURN_IF_ERROR(ExecNode::prepare(state));
|
||||
SCOPED_SWITCH_TASK_THREAD_LOCAL_MEM_TRACKER(mem_tracker());
|
||||
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
|
||||
|
||||
_num_rows_filtered_counter = ADD_COUNTER(_runtime_profile, "RowsFiltered", TUnit::UNIT);
|
||||
|
||||
RETURN_IF_ERROR(Expr::prepare(_fn_ctxs, state, _row_descriptor, expr_mem_tracker()));
|
||||
RETURN_IF_ERROR(Expr::prepare(_fn_ctxs, state, _row_descriptor));
|
||||
for (auto fn : _fns) {
|
||||
RETURN_IF_ERROR(fn->prepare());
|
||||
}
|
||||
@ -104,9 +104,9 @@ Status TableFunctionNode::prepare(RuntimeState* state) {
|
||||
Status TableFunctionNode::open(RuntimeState* state) {
|
||||
START_AND_SCOPE_SPAN(state->get_tracer(), span, "TableFunctionNode::open");
|
||||
SCOPED_TIMER(_runtime_profile->total_time_counter());
|
||||
SCOPED_SWITCH_TASK_THREAD_LOCAL_MEM_TRACKER(mem_tracker());
|
||||
RETURN_IF_CANCELLED(state);
|
||||
RETURN_IF_ERROR(ExecNode::open(state));
|
||||
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
|
||||
|
||||
RETURN_IF_ERROR(Expr::open(_fn_ctxs, state));
|
||||
RETURN_IF_ERROR(vectorized::VExpr::open(_vfn_ctxs, state));
|
||||
@ -198,7 +198,7 @@ bool TableFunctionNode::_roll_table_functions(int last_eos_idx) {
|
||||
// And the inner loop is to expand the row by table functions, and output row by row.
|
||||
Status TableFunctionNode::get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) {
|
||||
SCOPED_TIMER(_runtime_profile->total_time_counter());
|
||||
SCOPED_SWITCH_TASK_THREAD_LOCAL_EXISTED_MEM_TRACKER(mem_tracker());
|
||||
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
|
||||
|
||||
const RowDescriptor& parent_rowdesc = row_batch->row_desc();
|
||||
const RowDescriptor& child_rowdesc = _children[0]->row_desc();
|
||||
|
||||
Reference in New Issue
Block a user