dawidwys commented on a change in pull request #10595: [Flink-13197] Fix Hive view row type mismatch when expanding in planner URL: https://github.com/apache/flink/pull/10595#discussion_r358794726
########## File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/common/ViewsExpandingTest.scala ########## @@ -91,6 +91,39 @@ class ViewsExpandingTest(tableTestUtil: TableTestBase => TableTestUtil) extends tableUtil.verifyPlan(query) } + @Test + def testViewExpandingWithMismatchRowType(): Unit = { + val tableUtil = tableTestUtil(this) + val tableEnv = tableUtil.tableEnv + tableUtil.addDataStream[(Int, String, Int)]("t1", 'a, 'b, 'c) + def createAggSqlView(originTable: String): CatalogView = { + new CatalogViewImpl( + s"select a, b, count(c) from $originTable group by a, b", + s"select a, b, count(c) from $originTable group by a, b", + TableSchema.builder() + .field("a", DataTypes.INT().notNull()) // Change the nullability intentionally. + .field("b", DataTypes.STRING()) + .field("c", DataTypes.INT()) + .build(), + new util.HashMap[String, String](), + "" + ) + } + val catalog = tableEnv.getCatalog(tableEnv.getCurrentCatalog).get() Review comment: Let's test one thing at a time. We don't need to go through multiple views to test types casting. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services