RocMarshal commented on a change in pull request #17352:
URL: https://github.com/apache/flink/pull/17352#discussion_r716039173
##########
File path:
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/catalog/CatalogViewITCase.scala
##########
@@ -307,6 +307,91 @@ class CatalogViewITCase(isStreamingMode: Boolean) extends
AbstractTestBase {
// now we only have permanent view T3
assertEquals(permanentViewData.sorted,
TestCollectionTableFactory.RESULT.sorted)
}
+
+ @Test
+ def testShowCreateView(): Unit = {
+ val sourceData = List(toRow(1, "1000", 2))
+ TestCollectionTableFactory.initData(sourceData)
+ val tableDDL: String =
+ s"""CREATE TABLE T1 (
+ |a int,
+ |b varchar,
+ |c int
+ |) with (
+ |'connector' = 'COLLECTION'
+ |)""".stripMargin
+ val tView1DDL: String = "CREATE TEMPORARY VIEW t_v1 AS SELECT a, b, c FROM
T1"
+ val tView2DDL = "CREATE TEMPORARY VIEW t_v2(d, e, f) AS SELECT a, b, c
FROM T1"
+ val view1DDL = "CREATE VIEW v1 AS SELECT a, b, c FROM T1"
+ val view2DDL = "CREATE VIEW v2(x, y, z) AS SELECT a, b, c FROM T1"
+ tableEnv.executeSql(tableDDL)
+ tableEnv.executeSql(tView1DDL)
+ tableEnv.executeSql(tView2DDL)
+ tableEnv.executeSql(view1DDL)
+ tableEnv.executeSql(view2DDL)
+ testShowCreateTemporaryView(tableEnv)
+ testShowCreateView(tableEnv)
Review comment:
Good idea.
Done.
--
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]