Skip to content

Commit

Permalink
[fix](profile) only printed for non-sink nodes in the merge profile. (#…
Browse files Browse the repository at this point in the history
…44040)

### What problem does this PR solve?
In the past, the result sink did not have a plan node ID, which led to
incorrect plan info being output.
 Now, the plan info for sinks is not printed.

before
```
MergedProfile  
          Fragments:
              Fragment  0:
                  Pipeline  :  0(instance_num=1):
                        -  WaitWorkerTime:  avg  30.984us,  max  30.984us,  min  30.984us
                      RESULT_SINK_OPERATOR  (id=0):
                            -  PlanInfo
                                  -  TABLE:  test.big_string_table(big_string_table),  PREAGGREGATION:  ON
                                  -  partitions=1/1  (big_string_table)
                                  -  tablets=3/3,  tabletList=113264,113266,113268
                                  -  cardinality=131072,  avgRowSize=13.638229,  numNodes=1
                                  -  pushAggOp=COUNT
                                  -  projections:  1
                                  -  project  output  tuple  id:  1
                          OLAP_SCAN_OPERATOR  (id=0.  nereids_id=156.  table  name  =  big_string_table(big_string_table)):
```
now
```
MergedProfile  
          Fragments:
              Fragment  0:
                  Pipeline  :  0(instance_num=1):
                        -  WaitWorkerTime:  avg  32.576us,  max  32.576us,  min  32.576us
                      RESULT_SINK_OPERATOR  (id=0):
                          OLAP_SCAN_OPERATOR  (id=0.  nereids_id=156.  table  name  =  big_string_table(big_string_table)):
                                -  PlanInfo
                                      -  TABLE:  test.big_string_table(big_string_table),  PREAGGREGATION:  ON
                                      -  partitions=1/1  (big_string_table)
                                      -  tablets=3/3,  tabletList=113264,113266,113268
                                      -  cardinality=131072,  avgRowSize=0.0,  numNodes=1
                                      -  pushAggOp=COUNT
                                      -  projections:  1
                                      -  project  output  tuple  id:  1
```
  • Loading branch information
Mryange authored and Your Name committed Nov 19, 2024
1 parent b4e136b commit 34fdd46
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,17 @@ public void addChildWithCheck(RuntimeProfile child, Map<Integer, String> planNod
if (planNodeMap == null || !planNodeMap.containsKey(child.nodeId())) {
return;
}
child.addPlanNodeInfos(planNodeMap.get(child.nodeId()));
planNodeMap.remove(child.nodeId());

/*
* The check for SINK_OPERATOR is performed because SINK_OPERATOR does not have
* a corresponding plan node ID.
* Currently, the plan node info is only printed for non-sink nodes in the merge
* profile.
*/
if (name.contains("_SINK_OPERATOR")) {
child.addPlanNodeInfos(planNodeMap.get(child.nodeId()));
planNodeMap.remove(child.nodeId());
}
}

public void addPlanNodeInfos(String infos) {
Expand Down

0 comments on commit 34fdd46

Please sign in to comment.