wuchong commented on a change in pull request #15340:
URL: https://github.com/apache/flink/pull/15340#discussion_r599608696
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentITCase.scala
##########
@@ -447,6 +447,50 @@ class TableEnvironmentITCase(tableEnvName: String,
isStreaming: Boolean) extends
assertFirstValues(sinkPath)
}
+ @Test
+ def testTableDMLSync(): Unit = {
+ tEnv.getConfig.getConfiguration.set(TableConfigOptions.TABLE_DML_SYNC,
Boolean.box(true));
+ val sink1Path = _tempFolder.newFolder().toString
+ tEnv.executeSql(
+ s"""
+ |create table MySink1 (
+ | first string
+ |) with (
+ | 'connector' = 'filesystem',
+ | 'path' = '$sink1Path',
+ | 'format' = 'testcsv'
+ |)
+ """.stripMargin
+ )
+
+ val sink2Path = _tempFolder.newFolder().toString
+ tEnv.executeSql(
+ s"""
+ |create table MySink2 (
+ | first string
+ |) with (
+ | 'connector' = 'filesystem',
+ | 'path' = '$sink2Path',
+ | 'format' = 'testcsv'
+ |)
+ """.stripMargin
+ )
+
+ val tableResult1 =
+ tEnv.sqlQuery("select first from MyTable").executeInsert("MySink1",
false)
+ checkInsertTableResult(tableResult1,
"default_catalog.default_database.MySink1")
+ assertFirstValues(sink1Path)
+
+ val tableResult2 =
+ tEnv.sqlQuery("select first from MySink1").executeInsert("MySink2",
false)
+ checkInsertTableResult(tableResult2,
"default_catalog.default_database.MySink2")
+ assertFirstValues(sink2Path)
+
+ // invoke await again
+ tableResult1.await()
+ tableResult2.await()
Review comment:
Could you add comment to mention 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]