Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Dec 10, 2024
1 parent 003211f commit c45e865
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public String getNodeExplainString(String prefix, TExplainLevel detailLevel) {
.append(getExplainString(conjuncts, prefix)).append("\n");
}
if (!runtimeFilters.isEmpty()) {
output.append(prefix).append("runtime filters: ");
output.append(getRuntimeFilterExplainString(false));
output.append(prefix).append("runtime filters:\n");
output.append(getRuntimeFilterExplainString(false, prefix));
}

output.append(prefix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void setTabletSinkTxnId(long txnId) {
@Override
public String getExplainString(String prefix, TExplainLevel explainLevel) {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(prefix).append("stream data sink\n");
strBuilder.append(prefix).append("STREAM_DATA_SINK\n");
strBuilder.append(prefix).append(" exchange id: ").append(exchNodeId);
if (outputPartition != null) {
strBuilder.append("\n").append(prefix).append(" ").append(outputPartition.getExplainString(explainLevel));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,8 @@ public String getNodeExplainString(String detailPrefix, TExplainLevel detailLeve
.append(getExplainString(conjuncts, detailPrefix)).append("\n");
}
if (!runtimeFilters.isEmpty()) {
output.append(detailPrefix).append("runtime filters: ");
output.append(getRuntimeFilterExplainString(true));
output.append(detailPrefix).append("runtime filters:\n");
output.append(getRuntimeFilterExplainString(true, detailPrefix));
}
output.append(detailPrefix).append(String.format("cardinality=%,d", cardinality)).append("\n");
if (outputTupleDesc != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public String getNodeExplainString(String detailPrefix, TExplainLevel detailLeve
}
if (!runtimeFilters.isEmpty()) {
output.append(detailPrefix).append("runtime filters: ");
output.append(getRuntimeFilterExplainString(true));
output.append(getRuntimeFilterExplainString(true, detailPrefix));
}
output.append(detailPrefix).append("is output left side only: ").append(isOutputLeftSideOnly).append("\n");
output.append(detailPrefix).append(String.format("cardinality=%,d", cardinality)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1374,8 +1374,8 @@ public String getNodeExplainString(String prefix, TExplainLevel detailLevel) {
output.append(prefix).append("PREDICATES: ").append(expr.toSql()).append("\n");
}
if (!runtimeFilters.isEmpty()) {
output.append(prefix).append("runtime filters: ");
output.append(getRuntimeFilterExplainString(false));
output.append(prefix).append("runtime filters:\n");
output.append(getRuntimeFilterExplainString(false, prefix));
}

String selectedPartitions = getSelectedPartitionIds().stream().sorted()
Expand Down
13 changes: 9 additions & 4 deletions fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -1206,19 +1206,24 @@ public void clearRuntimeFilters() {
runtimeFilters.clear();
}

protected String getRuntimeFilterExplainString(boolean isBuildNode, boolean isBrief) {
protected String getRuntimeFilterExplainString(boolean isBuildNode, boolean isBrief, String prefix) {
if (runtimeFilters.isEmpty()) {
return "";
}
List<String> filtersStr = new ArrayList<>();
for (RuntimeFilter filter : runtimeFilters) {
filtersStr.add(filter.getExplainString(isBuildNode, isBrief, getId()));
filtersStr.add(prefix + " " + filter.getExplainString(isBuildNode, isBrief, getId()));
}
return Joiner.on(", ").join(filtersStr) + "\n";
return Joiner.on("\n").join(filtersStr) + "\n";
}

protected String getRuntimeFilterExplainString(boolean isBuildNode, String prefix) {
return getRuntimeFilterExplainString(isBuildNode, false, prefix);
}

// For test only
protected String getRuntimeFilterExplainString(boolean isBuildNode) {
return getRuntimeFilterExplainString(isBuildNode, false);
return getRuntimeFilterExplainString(isBuildNode, false, "");
}

/**
Expand Down

0 comments on commit c45e865

Please sign in to comment.