JingsongLi commented on a change in pull request #10978: [FLINK-15584] Give
nested data type of ROWs in ValidationException.
URL: https://github.com/apache/flink/pull/10978#discussion_r388029793
##########
File path:
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/batch/sql/validation/InsertIntoValidationTest.scala
##########
@@ -74,4 +74,22 @@ class InsertIntoValidationTest extends TableTestBase {
// must fail because partial insert is not supported yet.
util.tableEnv.sqlUpdate(sql)
}
+
+ @Test
+ def testValidationExceptionMessage(): Unit = {
+ expectedException.expect(classOf[ValidationException])
+ expectedException.expectMessage("TableSink schema: [a: Integer, b: Row"
+
+ "(f0: Integer, f1: Integer, f2: Integer)]")
+ val util = batchTestUtil()
+ util.addTable[(Int, Long, String)]("sourceTable", 'a, 'b, 'c)
+ val fieldNames = Array("a", "b")
+ val fieldTypes: Array[TypeInformation[_]] = Array(Types.INT, Types.ROW
+ (Types.INT, Types.INT, Types.INT))
+ val sink = new MemoryTableSourceSinkUtil.UnsafeMemoryAppendTableSink
+ util.tableEnv.registerTableSink("targetTable", sink.configure(fieldNames,
+ fieldTypes))
+
+ val sql = "INSERT INTO targetTable SELECT a, b FROM sourceTable"
+
+ util.tableEnv.sqlUpdate(sql)}
Review comment:
Minor, `}` should be new line. I will modify it before merge.
----------------------------------------------------------------
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]
With regards,
Apache Git Services