Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
ywqzzy committed Mar 21, 2023
1 parent 03caa90 commit 070f3aa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 32 deletions.
5 changes: 4 additions & 1 deletion dbms/src/Flash/Coprocessor/DAGContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void DAGContext::initOutputInfo()
}


void DAGContext::initListBasedExecutors() const
void DAGContext::initListBasedExecutors()
{
if (!isTreeBasedExecutors())
{
Expand All @@ -189,6 +189,9 @@ void DAGContext::initListBasedExecutors() const
{
auto * executor = dag_request->mutable_executors(i);
const auto & executor_id = id_generator.generate(*executor);
list_based_executors_order.push_back(executor_id);
// Set executor_id for list based executor,
// then we can fill executor_id for Execution Summaries of list-based executors
executor->set_executor_id(executor_id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Flash/Coprocessor/DAGContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class DAGContext
private:
void initExecutorIdToJoinIdMap();
void initOutputInfo();
void initListBasedExecutors() const;
void initListBasedExecutors();
bool isTreeBasedExecutors() const;

private:
Expand Down
54 changes: 28 additions & 26 deletions dbms/src/Flash/Statistics/ExecutorStatisticsCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,35 @@ void ExecutorStatisticsCollector::initialize(DAGContext * dag_context_)
{
dag_context = dag_context_;
assert(dag_context);
RUNTIME_CHECK(dag_context->dag_request);

traverseExecutors(dag_context->dag_request, [&](const tipb::Executor & executor) {
RUNTIME_CHECK(executor.has_executor_id());
if (!append<
AggStatistics,
ExchangeReceiverStatistics,
ExchangeSenderStatistics,
FilterStatistics,
JoinStatistics,
LimitStatistics,
ProjectStatistics,
SortStatistics,
TableScanStatistics,
TopNStatistics,
WindowStatistics,
ExpandStatistics>(&executor))
{
throw TiFlashException(
fmt::format("Unknown executor type, executor_id: {}", executor.executor_id()),
Errors::Coprocessor::Internal);
}
return true;
});

fillListBasedExecutorsChild();
fillTreeBasedExecutorsChildren();
if likely (dag_context->dag_request)
{
traverseExecutors(dag_context->dag_request, [&](const tipb::Executor & executor) {
RUNTIME_CHECK(executor.has_executor_id());
if (!append<
AggStatistics,
ExchangeReceiverStatistics,
ExchangeSenderStatistics,
FilterStatistics,
JoinStatistics,
LimitStatistics,
ProjectStatistics,
SortStatistics,
TableScanStatistics,
TopNStatistics,
WindowStatistics,
ExpandStatistics>(&executor))
{
throw TiFlashException(
fmt::format("Unknown executor type, executor_id: {}", executor.executor_id()),
Errors::Coprocessor::Internal);
}
return true;
});

fillListBasedExecutorsChild();
fillTreeBasedExecutorsChildren();
}
}

void ExecutorStatisticsCollector::fillListBasedExecutorsChild()
Expand Down
8 changes: 4 additions & 4 deletions dbms/src/Flash/tests/gtest_pipeline_interpreter.out
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,14 @@ CreatingSets
~test_suite_name: ListBase
~result_index: 0
~result:
pipeline#0: AggregationConvergent|3_aggregation -> Filter|4_selection -> Limit|5_limit -> Projection|NonTiDBOperator
|- pipeline#1: MockTableScan|1_table_scan -> Filter|2_selection -> AggregationBuild|3_aggregation
pipeline#0: AggregationConvergent|aggregation_2 -> Filter|selection_3 -> Limit|limit_4 -> Projection|NonTiDBOperator
|- pipeline#1: MockTableScan|table_scan_0 -> Filter|selection_1 -> AggregationBuild|aggregation_2
@
~test_suite_name: ListBase
~result_index: 1
~result:
pipeline#0: AggregationConvergent|3_aggregation -> Filter|4_selection -> TopN|5_top_n -> Projection|NonTiDBOperator
|- pipeline#1: MockTableScan|1_table_scan -> Filter|2_selection -> AggregationBuild|3_aggregation
pipeline#0: AggregationConvergent|aggregation_2 -> Filter|selection_3 -> TopN|topn_4 -> Projection|NonTiDBOperator
|- pipeline#1: MockTableScan|table_scan_0 -> Filter|selection_1 -> AggregationBuild|aggregation_2
@
~test_suite_name: ExpandPlan
~result_index: 0
Expand Down

0 comments on commit 070f3aa

Please sign in to comment.