morrySnow commented on code in PR #60572:
URL: https://github.com/apache/doris/pull/60572#discussion_r2781701344
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/memo/Group.java:
##########
@@ -486,53 +486,163 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder str = new StringBuilder("Group[" + groupId + "]\n");
- str.append(" logical expressions:\n");
- for (GroupExpression logicalExpression : logicalExpressions) {
- str.append(" ").append(logicalExpression).append("\n");
+ // Logical expressions with numbering
+ str.append(" Logical Expressions:\n");
+ if (logicalExpressions.isEmpty()) {
+ str.append(" (none)\n");
+ } else {
+ int index = 1;
+ for (GroupExpression logicalExpression : logicalExpressions) {
+ str.append(" [").append(index++).append("]
").append(logicalExpression).append("\n");
+ }
}
- str.append(" physical expressions:\n");
- for (GroupExpression physicalExpression : physicalExpressions) {
- str.append(" ").append(physicalExpression).append("\n");
+ // Physical expressions with numbering
+ str.append(" Physical Expressions:\n");
+ if (physicalExpressions.isEmpty()) {
+ str.append(" (none)\n");
+ } else {
+ int index = 1;
+ for (GroupExpression physicalExpression : physicalExpressions) {
+ str.append(" [").append(index++).append("]
").append(physicalExpression).append("\n");
+ }
}
- str.append(" enforcers:\n");
+ // Enforcers with numbering
+ str.append(" Enforcers:\n");
List<GroupExpression> enforcerList = enforcers.keySet().stream()
.sorted(java.util.Comparator.comparing(e1 ->
e1.getId().asInt()))
.collect(Collectors.toList());
- for (GroupExpression enforcer : enforcerList) {
- str.append(" ").append(enforcer).append("\n");
+ if (enforcerList.isEmpty()) {
+ str.append(" (none)\n");
+ } else {
+ int index = 1;
+ for (GroupExpression enforcer : enforcerList) {
+ str.append(" [").append(index++).append("]
").append(enforcer).append("\n");
+ }
}
if (!chosenEnforcerIdList.isEmpty()) {
- str.append(" chosen enforcer(id, requiredProperties):\n");
+ str.append(" ⭐ Chosen Enforcer(ID, RequiredProperties):\n");
Review Comment:
do not add emoji in toString
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]