mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
IMPALA-1005: Print consistent plan fragment ids in explain plan and runtime profile.
Change-Id: I63b59a896dc9dc0c9ed1d5e889f7b5626ba61202 Reviewed-on: http://gerrit.ent.cloudera.com:8080/3037 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: jenkins Reviewed-on: http://gerrit.ent.cloudera.com:8080/3124
This commit is contained in:
@@ -911,7 +911,9 @@ void Coordinator::InitExecProfile(const TQueryExecRequest& request) {
|
||||
// register coordinator's fragment profile now, before those of the backends,
|
||||
// so it shows up at the top
|
||||
query_profile_->AddChild(executor_->profile());
|
||||
executor_->profile()->set_name("Coordinator Fragment");
|
||||
stringstream ss;
|
||||
ss << "Coordinator Fragment " << request.fragments[0].display_name;
|
||||
executor_->profile()->set_name(ss.str());
|
||||
CollectScanNodeCounters(executor_->profile(), &coordinator_counters_);
|
||||
}
|
||||
|
||||
@@ -930,7 +932,7 @@ void Coordinator::InitExecProfile(const TQueryExecRequest& request) {
|
||||
continue;
|
||||
}
|
||||
stringstream ss;
|
||||
ss << "Averaged Fragment " << i;
|
||||
ss << "Averaged Fragment " << request.fragments[i].display_name;
|
||||
fragment_profiles_[i].averaged_profile =
|
||||
obj_pool()->Add(new RuntimeProfile(obj_pool(), ss.str(), true));
|
||||
// Insert the avg profiles in ascending fragment number order. If
|
||||
@@ -944,7 +946,7 @@ void Coordinator::InitExecProfile(const TQueryExecRequest& request) {
|
||||
(i > 0) ? fragment_profiles_[i-1].averaged_profile : NULL);
|
||||
|
||||
ss.str("");
|
||||
ss << "Fragment " << i;
|
||||
ss << "Fragment " << request.fragments[i].display_name;
|
||||
fragment_profiles_[i].root_profile =
|
||||
obj_pool()->Add(new RuntimeProfile(obj_pool(), ss.str()));
|
||||
// Note: we don't start the wall timer here for the fragment
|
||||
|
||||
@@ -28,6 +28,9 @@ include "Partitions.thrift"
|
||||
// plan fragment, including how to produce and how to partition its output.
|
||||
// It leaves out node-specific parameters neede for the actual execution.
|
||||
struct TPlanFragment {
|
||||
// display name to be shown in the runtime profile; unique within a query
|
||||
1: required string display_name
|
||||
|
||||
// no plan or descriptor table: query without From clause
|
||||
2: optional PlanNodes.TPlan plan
|
||||
|
||||
|
||||
@@ -254,6 +254,7 @@ public class PlanFragment {
|
||||
|
||||
public TPlanFragment toThrift() {
|
||||
TPlanFragment result = new TPlanFragment();
|
||||
result.setDisplay_name(fragmentId_.toString());
|
||||
if (planRoot_ != null) result.setPlan(planRoot_.treeToThrift());
|
||||
if (outputExprs_ != null) {
|
||||
result.setOutput_exprs(Expr.treesToThrift(outputExprs_));
|
||||
|
||||
Reference in New Issue
Block a user