liyafan82 commented on a change in pull request #2128:
URL: https://github.com/apache/calcite/pull/2128#discussion_r481980105



##########
File path: core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
##########
@@ -658,14 +658,25 @@
     final RelJsonWriter jsonWriter = new RelJsonWriter();
     rel.explain(jsonWriter);
     final String relJson = jsonWriter.asString();
-    String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson);
-    final String expected = ""
+    String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson, format);
+    assertThat(s, isLinux(expected));
+  }
+
+  @Test void testAggregateWithAlias() {
+    testAggregateWithAlias0(SqlExplainFormat.TEXT, ""
         + "LogicalProject(max_sal=[$1])\n"
         + "  LogicalAggregate(group=[{0}], max_sal=[MAX($1)])\n"
         + "    LogicalProject(JOB=[$2], SAL=[$5])\n"
-        + "      LogicalTableScan(table=[[scott, EMP]])\n";
+        + "      LogicalTableScan(table=[[scott, EMP]])\n");
 
-    assertThat(s, isLinux(expected));
+    testAggregateWithAlias0(SqlExplainFormat.DOT, "digraph {\n"
+        + "\"LogicalProject(max_s\\nal=[$1])\" -> 
\"LogicalAggregate(gro\\nup=[{0}], "
+        + "max_sal=[M\\nAX($1)])\" [label=\"0\"]\n"
+        + "\"LogicalAggregate(gro\\nup=[{0}], max_sal=[M\\nAX($1)])\" -> 
\"LogicalProject"

Review comment:
       Sounds reasonable. It seems @danny0405 has a similar suggestion.
   I have revised the PR to fix this. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to