diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp index eaf9746c6b..08b29bdb2a 100644 --- a/be/src/exec/exec_node.cpp +++ b/be/src/exec/exec_node.cpp @@ -525,12 +525,6 @@ void ExecNode::reached_limit(vectorized::Block* block, bool* eos) { COUNTER_SET(_rows_returned_counter, _num_rows_returned); } -Status ExecNode::QueryMaintenance(RuntimeState* state, const std::string& msg) { - // TODO chenhao , when introduce latest AnalyticEvalNode open it - // ScalarExprEvaluator::FreeLocalAllocations(evals_to_free_); - return state->check_query_state(msg); -} - Status ExecNode::get_next(RuntimeState* state, vectorized::Block* block, bool* eos) { return Status::NotSupported("Not Implemented get block"); } diff --git a/be/src/exec/exec_node.h b/be/src/exec/exec_node.h index 5d6f1f18b2..0905f1788d 100644 --- a/be/src/exec/exec_node.h +++ b/be/src/exec/exec_node.h @@ -316,14 +316,6 @@ protected: // Appends option to '_runtime_exec_options' void add_runtime_exec_option(const std::string& option); - /// Frees any local allocations made by evals_to_free_ and returns the result of - /// state->CheckQueryState(). Nodes should call this periodically, e.g. once per input - /// row batch. This should not be called outside the main execution thread. - // - /// Nodes may override this to add extra periodic cleanup, e.g. freeing other local - /// allocations. ExecNodes overriding this function should return - /// ExecNode::QueryMaintenance(). - virtual Status QueryMaintenance(RuntimeState* state, const std::string& msg) WARN_UNUSED_RESULT; std::atomic _can_read = false; private: diff --git a/be/src/pipeline/exec/operator.h b/be/src/pipeline/exec/operator.h index 32ede3618a..7eceacae7d 100644 --- a/be/src/pipeline/exec/operator.h +++ b/be/src/pipeline/exec/operator.h @@ -89,8 +89,6 @@ public: std::string get_name() const { return _name; } - RuntimeState* runtime_state() { return _state; } - virtual const RowDescriptor& row_desc() = 0; int32_t id() const { return _id; } diff --git a/be/src/pipeline/pipeline_fragment_context.cpp b/be/src/pipeline/pipeline_fragment_context.cpp index 17187a7c21..8272aa7bfe 100644 --- a/be/src/pipeline/pipeline_fragment_context.cpp +++ b/be/src/pipeline/pipeline_fragment_context.cpp @@ -200,7 +200,6 @@ Status PipelineFragmentContext::prepare(const doris::TExecPlanFragmentParams& re // 2. Create ExecNode to build pipeline with PipelineFragmentContext RETURN_IF_ERROR(ExecNode::create_tree(_runtime_state.get(), _runtime_state->obj_pool(), request.fragment.plan, *desc_tbl, &_root_plan)); - _runtime_state->set_fragment_root_id(_root_plan->id()); // Set senders of exchange nodes before pipeline build std::vector exch_nodes; diff --git a/be/src/pipeline/pipeline_task.cpp b/be/src/pipeline/pipeline_task.cpp index 1f7d12f15d..88bdfe724a 100644 --- a/be/src/pipeline/pipeline_task.cpp +++ b/be/src/pipeline/pipeline_task.cpp @@ -124,7 +124,7 @@ Status PipelineTask::execute(bool* eos) { SCOPED_TIMER(_task_profile->total_time_counter()); SCOPED_CPU_TIMER(_task_cpu_timer); SCOPED_TIMER(_exec_timer); - SCOPED_ATTACH_TASK(runtime_state()); + SCOPED_ATTACH_TASK(_state); int64_t time_spent = 0; // The status must be runnable *eos = false; diff --git a/be/src/pipeline/pipeline_task.h b/be/src/pipeline/pipeline_task.h index 4481a01368..a83bf8c3be 100644 --- a/be/src/pipeline/pipeline_task.h +++ b/be/src/pipeline/pipeline_task.h @@ -177,8 +177,6 @@ public: std::string debug_string() const; - RuntimeState* runtime_state() { return _state; } - uint32_t total_schedule_time() const { return _schedule_time; } static constexpr auto THREAD_TIME_SLICE = 100'000'000L; diff --git a/be/src/runtime/plan_fragment_executor.cpp b/be/src/runtime/plan_fragment_executor.cpp index 91d9b414e4..f8254ec3cc 100644 --- a/be/src/runtime/plan_fragment_executor.cpp +++ b/be/src/runtime/plan_fragment_executor.cpp @@ -133,7 +133,6 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request, DCHECK(request.__isset.fragment); RETURN_IF_ERROR(ExecNode::create_tree(_runtime_state.get(), obj_pool(), request.fragment.plan, *desc_tbl, &_plan)); - _runtime_state->set_fragment_root_id(_plan->id()); // set #senders of exchange nodes before calling Prepare() std::vector exch_nodes; diff --git a/be/src/runtime/runtime_state.cpp b/be/src/runtime/runtime_state.cpp index 8ab72aedd1..2b018d9306 100644 --- a/be/src/runtime/runtime_state.cpp +++ b/be/src/runtime/runtime_state.cpp @@ -53,7 +53,6 @@ RuntimeState::RuntimeState(const TUniqueId& fragment_instance_id, _unreported_error_idx(0), _is_cancelled(false), _per_fragment_instance_idx(0), - _root_node_id(-1), _num_rows_load_total(0), _num_rows_load_filtered(0), _num_rows_load_unselected(0), @@ -79,7 +78,6 @@ RuntimeState::RuntimeState(const TPlanFragmentExecParams& fragment_exec_params, _query_id(fragment_exec_params.query_id), _is_cancelled(false), _per_fragment_instance_idx(0), - _root_node_id(-1), _num_rows_load_total(0), _num_rows_load_filtered(0), _num_rows_load_unselected(0), @@ -257,19 +255,7 @@ Status RuntimeState::check_query_state(const std::string& msg) { const std::string ERROR_FILE_NAME = "error_log"; const int64_t MAX_ERROR_NUM = 50; -Status RuntimeState::create_load_dir() { - if (!_load_dir.empty()) { - return Status::OK(); - } - RETURN_IF_ERROR(_exec_env->load_path_mgr()->allocate_dir(_db_name, _import_label, &_load_dir)); - _load_dir += "/output"; - return FileUtils::create_dir(_load_dir); -} - Status RuntimeState::create_error_log_file() { - // Make sure that load dir exists. - // create_load_dir(); - _exec_env->load_path_mgr()->get_load_error_file_name( _db_name, _import_label, _fragment_instance_id, &_error_log_file_path); // std::stringstream ss; diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h index 9ef23e169d..35ace169de 100644 --- a/be/src/runtime/runtime_state.h +++ b/be/src/runtime/runtime_state.h @@ -74,13 +74,9 @@ public: // for ut and non-query. Status init_mem_trackers(const TUniqueId& query_id = TUniqueId()); - Status create_load_dir(); - const TQueryOptions& query_options() const { return _query_options; } ObjectPool* obj_pool() const { return _obj_pool.get(); } - std::shared_ptr obj_pool_ptr() const { return _obj_pool; } - const DescriptorTbl& desc_tbl() const { return *_desc_tbl; } void set_desc_tbl(const DescriptorTbl* desc_tbl) { _desc_tbl = desc_tbl; } int batch_size() const { return _query_options.batch_size; } @@ -103,21 +99,9 @@ public: ExecEnv* exec_env() { return _exec_env; } std::shared_ptr query_mem_tracker() { return _query_mem_tracker; } - void set_fragment_root_id(PlanNodeId id) { - DCHECK(_root_node_id == -1) << "Should not set this twice."; - _root_node_id = id; - } - - // The seed value to use when hashing tuples. - // See comment on _root_node_id. We add one to prevent having a hash seed of 0. - uint32_t fragment_hash_seed() const { return _root_node_id + 1; } - // Returns runtime state profile RuntimeProfile* runtime_profile() { return &_profile; } - // Returns true if codegen is enabled for this query. - bool codegen_enabled() const { return !_query_options.disable_codegen; } - bool enable_function_pushdown() const { return _query_options.__isset.enable_function_pushdown && _query_options.enable_function_pushdown; @@ -128,12 +112,6 @@ public: _query_options.check_overflow_for_decimal; } - // Create a codegen object in _codegen. No-op if it has already been called. - // If codegen is enabled for the query, this is created when the runtime - // state is created. If codegen is disabled for the query, this is created - // on first use. - Status create_codegen(); - Status query_status() { std::lock_guard l(_process_status_lock); return _process_status; @@ -197,8 +175,6 @@ public: void set_import_label(const std::string& import_label) { _import_label = import_label; } - const std::string& import_label() { return _import_label; } - const std::vector& export_output_files() const { return _export_output_files; } void add_export_output_file(const std::string& file) { _export_output_files.push_back(file); } @@ -213,14 +189,6 @@ public: int64_t load_job_id() const { return _load_job_id; } - int64_t get_normal_row_number() const { return _normal_row_number; } - - void set_normal_row_number(int64_t number) { _normal_row_number = number; } - - int64_t get_error_row_number() const { return _error_row_number; } - - void set_error_row_number(int64_t number) { _error_row_number = number; } - const std::string get_error_log_file_path() const { return _error_log_file_path; } // append error msg and error line to file when loading data. @@ -456,15 +424,6 @@ private: std::mutex _process_status_lock; Status _process_status; - // This is the node id of the root node for this plan fragment. This is used as the - // hash seed and has two useful properties: - // 1) It is the same for all exec nodes in a fragment, so the resulting hash values - // can be shared (i.e. for _slot_bitmap_filters). - // 2) It is different between different fragments, so we do not run into hash - // collisions after data partitioning (across fragments). See IMPALA-219 for more - // details. - PlanNodeId _root_node_id; - // put here to collect files?? std::vector _output_files; std::atomic _num_rows_load_total; // total rows read from source @@ -475,7 +434,6 @@ private: std::atomic _num_bytes_load_total; // total bytes read from source std::vector _export_output_files; - std::string _import_label; std::string _db_name; std::string _load_dir; diff --git a/be/src/service/point_query_executor.h b/be/src/service/point_query_executor.h index 99ec1986c6..02a0e79121 100644 --- a/be/src/service/point_query_executor.h +++ b/be/src/service/point_query_executor.h @@ -41,8 +41,6 @@ public: Status init(const TDescriptorTable& t_desc_tbl, const std::vector& output_exprs, size_t block_size = 1); - RuntimeState* runtime_state() { return _runtime_state.get(); } - std::unique_ptr get_block(); // do not touch block after returned diff --git a/be/src/vec/exec/vunion_node.cpp b/be/src/vec/exec/vunion_node.cpp index 864780a9bb..87f5ee5551 100644 --- a/be/src/vec/exec/vunion_node.cpp +++ b/be/src/vec/exec/vunion_node.cpp @@ -263,7 +263,6 @@ Status VUnionNode::get_next(RuntimeState* state, Block* block, bool* eos) { INIT_AND_SCOPE_GET_NEXT_SPAN(state->get_tracer(), _get_next_span, "VUnionNode::get_next"); SCOPED_TIMER(_runtime_profile->total_time_counter()); RETURN_IF_CANCELLED(state); - // RETURN_IF_ERROR(QueryMaintenance(state)); // TODO: Rethink the logic, which cause close the exec node twice. if (_to_close_child_idx != -1) { diff --git a/be/src/vec/olap/vcollect_iterator.h b/be/src/vec/olap/vcollect_iterator.h index 14785b5984..7ac29858cd 100644 --- a/be/src/vec/olap/vcollect_iterator.h +++ b/be/src/vec/olap/vcollect_iterator.h @@ -298,4 +298,4 @@ private: }; } // namespace vectorized -} // namespace doris +} // namespace doris \ No newline at end of file