V1ncentzzZ commented on a change in pull request #14165:
URL: https://github.com/apache/flink/pull/14165#discussion_r535940439
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentITCase.scala
##########
@@ -429,6 +429,26 @@ class TableEnvironmentITCase(tableEnvName: String,
isStreaming: Boolean) extends
assertLastValues(sink2Path)
}
+ @Test
+ def testExecutionPlanFromStatementSet(): Unit = {
+ val sink1Path = TestTableSourceSinks.createCsvTemporarySinkTable(
+ tEnv, new TableSchema(Array("first"), Array(STRING)), "MySink1")
+
+ val sink2Path = TestTableSourceSinks.createCsvTemporarySinkTable(
+ tEnv, new TableSchema(Array("last"), Array(STRING)), "MySink2")
+
+ val stmtSet = tEnv.createStatementSet()
+ stmtSet.addInsert("MySink1", tEnv.sqlQuery("select first from MyTable"))
+ .addInsertSql("insert into MySink2 select last from MyTable")
+
+ val actual = stmtSet.explain(ExplainDetail.JSON_EXECUTION_PLAN)
+ val expected =
+
TableTestUtil.readFromResource("/explain/testExecutionPlanFromStatementSet.out")
+
+ assertEquals(replaceStreamNodeIdAndParallelism(expected),
+ replaceStreamNodeIdAndParallelism(actual))
Review comment:
You means that move this tests to `TableEnvironmentTest ` from
`TableEnvironmentITCase`?
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -103,6 +103,26 @@ class TableEnvironmentTest {
assertEquals(TableTestUtil.replaceStageId(expected),
TableTestUtil.replaceStageId(actual))
}
+ @Test
+ def testStreamTableEnvironmentExecutionExplain(): Unit = {
Review comment:
Hi @godfreyhe , Sry, How i get legacy planner and add tests for it? it
also put in `TableEnvironmentTest`?
----------------------------------------------------------------
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]