This is an automated email from the ASF dual-hosted git repository.
liulijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new d86c67863d Remove unused code (#21735)
d86c67863d is described below
commit d86c67863d836b6ba3f0d824979873eaf92c3e19
Author: Lijia Liu <[email protected]>
AuthorDate: Wed Jul 12 14:48:13 2023 +0800
Remove unused code (#21735)
---
be/src/exec/exec_node.cpp | 32 ---------------------------
be/src/exec/exec_node.h | 6 -----
be/src/exec/scan_node.h | 5 -----
be/src/olap/reader.cpp | 1 -
be/src/olap/reader.h | 2 --
be/src/pipeline/pipeline_fragment_context.cpp | 1 -
be/src/runtime/plan_fragment_executor.cpp | 2 --
be/src/vec/exec/scan/new_olap_scan_node.cpp | 3 +--
be/src/vec/exec/scan/new_olap_scanner.cpp | 8 +------
be/src/vec/exec/scan/new_olap_scanner.h | 3 +--
be/src/vec/exec/scan/vscan_node.h | 3 ---
11 files changed, 3 insertions(+), 63 deletions(-)
diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp
index 8e91212eb2..938cbc2608 100644
--- a/be/src/exec/exec_node.cpp
+++ b/be/src/exec/exec_node.cpp
@@ -495,38 +495,6 @@ void ExecNode::collect_scan_nodes(vector<ExecNode*>*
nodes) {
collect_nodes(TPlanNodeType::META_SCAN_NODE, nodes);
}
-void ExecNode::try_do_aggregate_serde_improve() {
- std::vector<ExecNode*> agg_node;
- collect_nodes(TPlanNodeType::AGGREGATION_NODE, &agg_node);
- if (agg_node.size() != 1) {
- return;
- }
-
- if (agg_node[0]->_children.size() != 1) {
- return;
- }
-
- if (agg_node[0]->_children[0]->type() != TPlanNodeType::OLAP_SCAN_NODE) {
- return;
- }
-
- // TODO(cmy): should be removed when NewOlapScanNode is ready
- ExecNode* child0 = agg_node[0]->_children[0];
- if (typeid(*child0) == typeid(vectorized::NewOlapScanNode) ||
- typeid(*child0) == typeid(vectorized::NewFileScanNode) ||
- typeid(*child0) == typeid(vectorized::NewOdbcScanNode) ||
- typeid(*child0) == typeid(vectorized::NewEsScanNode) ||
- typeid(*child0) == typeid(vectorized::NewJdbcScanNode) ||
- typeid(*child0) == typeid(vectorized::VMetaScanNode)) {
- vectorized::VScanNode* scan_node =
- static_cast<vectorized::VScanNode*>(agg_node[0]->_children[0]);
- scan_node->set_no_agg_finalize();
- } else {
- ScanNode* scan_node =
static_cast<ScanNode*>(agg_node[0]->_children[0]);
- scan_node->set_no_agg_finalize();
- }
-}
-
void ExecNode::init_runtime_profile(const std::string& name) {
std::stringstream ss;
ss << name << " (id=" << _id << ")";
diff --git a/be/src/exec/exec_node.h b/be/src/exec/exec_node.h
index a2abd0eacb..55cdea53b6 100644
--- a/be/src/exec/exec_node.h
+++ b/be/src/exec/exec_node.h
@@ -196,12 +196,6 @@ public:
virtual void prepare_for_next() {}
- // When the agg node is the scan node direct parent,
- // we directly return agg object from scan node to agg node,
- // and don't serialize the agg object.
- // This improve is cautious, we ensure the correctness firstly.
- void try_do_aggregate_serde_improve();
-
// Returns a string representation in DFS order of the plan rooted at this.
std::string debug_string() const;
diff --git a/be/src/exec/scan_node.h b/be/src/exec/scan_node.h
index ddad887b66..2514b0d232 100644
--- a/be/src/exec/scan_node.h
+++ b/be/src/exec/scan_node.h
@@ -87,8 +87,6 @@ public:
bool is_scan_node() const override { return true; }
- void set_no_agg_finalize() { _need_agg_finalize = false; }
-
RuntimeProfile::Counter* bytes_read_counter() const { return
_bytes_read_counter; }
RuntimeProfile::Counter* rows_read_counter() const { return
_rows_read_counter; }
RuntimeProfile::Counter* total_throughput_counter() const { return
_total_throughput_counter; }
@@ -105,9 +103,6 @@ protected:
// Wall based aggregate read throughput [bytes/sec]
RuntimeProfile::Counter* _total_throughput_counter;
RuntimeProfile::Counter* _num_disks_accessed_counter;
-
-protected:
- bool _need_agg_finalize = true;
};
} // namespace doris
diff --git a/be/src/olap/reader.cpp b/be/src/olap/reader.cpp
index b6ad68542f..730fdf5145 100644
--- a/be/src/olap/reader.cpp
+++ b/be/src/olap/reader.cpp
@@ -255,7 +255,6 @@ Status TabletReader::_init_params(const ReaderParams&
read_params) {
_direct_mode = read_params.direct_mode;
_aggregation = read_params.aggregation;
- _need_agg_finalize = read_params.need_agg_finalize;
_reader_type = read_params.reader_type;
_tablet = read_params.tablet;
_tablet_schema = read_params.tablet_schema;
diff --git a/be/src/olap/reader.h b/be/src/olap/reader.h
index a2ab924061..231ff23d6e 100644
--- a/be/src/olap/reader.h
+++ b/be/src/olap/reader.h
@@ -98,7 +98,6 @@ public:
ReaderType reader_type = ReaderType::READER_QUERY;
bool direct_mode = false;
bool aggregation = false;
- bool need_agg_finalize = true;
// for compaction, schema_change, check_sum: we don't use page cache
// for query and config::disable_storage_page_cache is false, we use
page cache
bool use_page_cache = false;
@@ -266,7 +265,6 @@ protected:
bool _aggregation = false;
// for agg query, we don't need to finalize when scan agg object data
- bool _need_agg_finalize = true;
ReaderType _reader_type = ReaderType::READER_QUERY;
bool _next_delete_flag = false;
bool _filter_delete = false;
diff --git a/be/src/pipeline/pipeline_fragment_context.cpp
b/be/src/pipeline/pipeline_fragment_context.cpp
index 29f5b8d438..8eef37d931 100644
--- a/be/src/pipeline/pipeline_fragment_context.cpp
+++ b/be/src/pipeline/pipeline_fragment_context.cpp
@@ -274,7 +274,6 @@ Status PipelineFragmentContext::prepare(const
doris::TPipelineFragmentParams& re
VLOG_CRITICAL << "params.per_node_scan_ranges.size()="
<< local_params.per_node_scan_ranges.size();
- _root_plan->try_do_aggregate_serde_improve();
// set scan range in ScanNode
for (int i = 0; i < scan_nodes.size(); ++i) {
// TODO(cmy): this "if...else" should be removed once all ScanNode are
derived from VScanNode.
diff --git a/be/src/runtime/plan_fragment_executor.cpp
b/be/src/runtime/plan_fragment_executor.cpp
index d64c6f8c53..110b82d189 100644
--- a/be/src/runtime/plan_fragment_executor.cpp
+++ b/be/src/runtime/plan_fragment_executor.cpp
@@ -182,8 +182,6 @@ Status PlanFragmentExecutor::prepare(const
TExecPlanFragmentParams& request,
VLOG_CRITICAL << "scan_nodes.size()=" << scan_nodes.size();
VLOG_CRITICAL << "params.per_node_scan_ranges.size()=" <<
params.per_node_scan_ranges.size();
- _plan->try_do_aggregate_serde_improve();
-
for (int i = 0; i < scan_nodes.size(); ++i) {
// TODO(cmy): this "if...else" should be removed once all ScanNode are
derived from VScanNode.
ExecNode* node = scan_nodes[i];
diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp
b/be/src/vec/exec/scan/new_olap_scan_node.cpp
index 011bd3a3e4..cfd9e329f0 100644
--- a/be/src/vec/exec/scan/new_olap_scan_node.cpp
+++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp
@@ -508,8 +508,7 @@ Status
NewOlapScanNode::_init_scanners(std::list<VScannerSPtr>* scanners) {
const std::vector<std::pair<int, int>>&
rs_reader_seg_offsets) {
std::shared_ptr<NewOlapScanner> scanner =
NewOlapScanner::create_shared(
_state, this, _limit_per_scanner,
_olap_scan_node.is_preaggregation, scan_range,
- key_ranges, rs_readers, rs_reader_seg_offsets,
_need_agg_finalize,
- _scanner_profile.get());
+ key_ranges, rs_readers, rs_reader_seg_offsets,
_scanner_profile.get());
RETURN_IF_ERROR(scanner->prepare(_state, _conjuncts));
scanner->set_compound_filters(_compound_filters);
diff --git a/be/src/vec/exec/scan/new_olap_scanner.cpp
b/be/src/vec/exec/scan/new_olap_scanner.cpp
index e6763bf94b..0b631b143e 100644
--- a/be/src/vec/exec/scan/new_olap_scanner.cpp
+++ b/be/src/vec/exec/scan/new_olap_scanner.cpp
@@ -65,10 +65,9 @@ NewOlapScanner::NewOlapScanner(RuntimeState* state,
NewOlapScanNode* parent, int
const std::vector<OlapScanRange*>& key_ranges,
const std::vector<RowsetReaderSharedPtr>&
rs_readers,
const std::vector<std::pair<int, int>>&
rs_reader_seg_offsets,
- bool need_agg_finalize, RuntimeProfile* profile)
+ RuntimeProfile* profile)
: VScanner(state, static_cast<VScanNode*>(parent), limit, profile),
_aggregation(aggregation),
- _need_agg_finalize(need_agg_finalize),
_version(-1),
_scan_range(scan_range),
_key_ranges(key_ranges) {
@@ -376,11 +375,6 @@ Status NewOlapScanner::_init_tablet_reader_params(
}
}
- // If a agg node is this scan node direct parent
- // we will not call agg object finalize method in scan node,
- // to avoid the unnecessary SerDe and improve query performance
- _tablet_reader_params.need_agg_finalize = _need_agg_finalize;
-
if (!config::disable_storage_page_cache) {
_tablet_reader_params.use_page_cache = true;
}
diff --git a/be/src/vec/exec/scan/new_olap_scanner.h
b/be/src/vec/exec/scan/new_olap_scanner.h
index 28adc4d5fe..f44e55ee37 100644
--- a/be/src/vec/exec/scan/new_olap_scanner.h
+++ b/be/src/vec/exec/scan/new_olap_scanner.h
@@ -57,7 +57,7 @@ public:
const TPaloScanRange& scan_range, const
std::vector<OlapScanRange*>& key_ranges,
const std::vector<RowsetReaderSharedPtr>& rs_readers,
const std::vector<std::pair<int, int>>&
rs_reader_seg_offsets,
- bool need_agg_finalize, RuntimeProfile* profile);
+ RuntimeProfile* profile);
Status init() override;
@@ -88,7 +88,6 @@ private:
Status _init_return_columns();
bool _aggregation;
- bool _need_agg_finalize;
TabletSchemaSPtr _tablet_schema;
TabletSharedPtr _tablet;
diff --git a/be/src/vec/exec/scan/vscan_node.h
b/be/src/vec/exec/scan/vscan_node.h
index 481e3480dc..83e8909280 100644
--- a/be/src/vec/exec/scan/vscan_node.h
+++ b/be/src/vec/exec/scan/vscan_node.h
@@ -141,8 +141,6 @@ public:
Status close(RuntimeState* state) override;
- void set_no_agg_finalize() { _need_agg_finalize = false; }
-
// Clone current _conjuncts to conjuncts, if exists.
Status clone_conjunct_ctxs(VExprContextSPtrs& conjuncts);
@@ -296,7 +294,6 @@ protected:
// "_colname_to_value_range" and in "_not_in_value_ranges"
std::vector<ColumnValueRangeType> _not_in_value_ranges;
- bool _need_agg_finalize = true;
// If the query like select * from table limit 10; then the query should
run in
// single scanner to avoid too many scanners which will cause lots of
useless read.
bool _should_run_serial = false;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]