diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java index d1e3129244f0f88..0bd8f0ee1388b17 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java @@ -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(); + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java index 11baf2137ab5d81..f243937e33d0847 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java @@ -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" ); } @@ -329,6 +330,15 @@ public TopnPushInfo(List 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() { diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java index 446f49c37829022..f73a02c18cf2066 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java @@ -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(); diff --git a/regression-test/suites/query_p0/limit/test_group_by_limit.groovy b/regression-test/suites/query_p0/limit/test_group_by_limit.groovy index 271619c4a93cba3..c91a7aad81217c1 100644 --- a/regression-test/suites/query_p0/limit/test_group_by_limit.groovy +++ b/regression-test/suites/query_p0/limit/test_group_by_limit.groovy @@ -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; """