Skip to content

Commit

Permalink
agg limit
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Dec 10, 2024
1 parent 784a723 commit bb96d73
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
11 changes: 11 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,15 @@ public TSortInfo toThrift() {
}
return sortInfo;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("sortInfo[");
for (Expr expr : orderingExprs) {
sb.append(expr.toString()).append(" ");
}
sb.append("]");
return sb.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ public String toString() {
"outputExpr", outputExpressions,
"partitionExpr", partitionExpressions,
"topnFilter", topnPushInfo != null,
"topnPushDown", getMutableState(MutableState.KEY_PUSH_TOPN_TO_AGG).isPresent()
"topnPushInfo", getMutableState(MutableState.KEY_PUSH_TOPN_TO_AGG).isPresent()
? (TopnPushInfo) getMutableState(MutableState.KEY_PUSH_TOPN_TO_AGG).get() : "false"
);
}

Expand Down Expand Up @@ -329,6 +330,15 @@ public TopnPushInfo(List<OrderKey> orderkeys, long limit) {
this.orderkeys = ImmutableList.copyOf(orderkeys);
this.limit = limit;
}

@Override
public String toString() {
StringBuilder builder = new StringBuilder("[");
builder.append("orderkeys=").append(orderkeys);
builder.append(", limit=").append(limit);
builder.append("]");
return builder.toString();
}
}

public TopnPushInfo getTopnPushInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public String getNodeExplainString(String detailPrefix, TExplainLevel detailLeve
if (!conjuncts.isEmpty()) {
output.append(detailPrefix).append("having: ").append(getExplainString(conjuncts)).append("\n");
}
output.append(detailPrefix).append("sortByGroupKey:").append(sortByGroupKey != null).append("\n");
output.append(detailPrefix).append("sortInfo:").append(sortByGroupKey).append("\n");
output.append(detailPrefix).append(String.format(
"cardinality=%,d", cardinality)).append("\n");
return output.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ qt_select """ select sum(orderkey), count(partkey), month(commitdate) from tpc


// mutli column
qt_select """ select sum(orderkey), count(partkey), shipmode, linenumber from tpch_tiny_lineitem group by shipmode, linenumber limit 3; """
qt_select """ select /*+SET_VAR(enable_compress_materialize=false)*/ sum(orderkey), count(partkey), shipmode, linenumber from tpch_tiny_lineitem group by shipmode, linenumber limit 3; """

qt_select """ select sum(orderkey), count(partkey), shipmode, linenumber , tax from tpch_tiny_lineitem group by shipmode, linenumber, tax limit 3; """

Expand Down

0 comments on commit bb96d73

Please sign in to comment.