dawidwys commented on a change in pull request #8057: [FLINK-12028][table] Add 
`addColumns`,`renameColumns`, `dropColumns` …
URL: https://github.com/apache/flink/pull/8057#discussion_r270330432
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/batch/table/validation/CalcValidationTest.scala
 ##########
 @@ -128,4 +128,96 @@ class CalcValidationTest extends TableTestBase {
 
     table.select('a.flatten(), 'a.flatten())
   }
+
+  @Test
+  def testAddColumns(): Unit = {
+    val util = batchTestUtil()
+    val tab = util.addTable[(Int, Long, String)]("Table3",'a, 'b, 'c)
+
+    // Test aggregates
+    try {
+      tab.addColumns('a.sum)
+      fail("TableException expected")
+    } catch {
+      case _: TableException => //ignore
+    }
+
+    // Test replace the existing column, but do not with the alias.
+    try {
+      tab.addColumns(true, concat('c, "Sunny"))
+      fail("TableException expected")
+    } catch {
+      case _: TableException => //ignore
+    }
+
+  }
+
+  @Test
+  def testRenameColumns(): Unit = {
+    val util = batchTestUtil()
+    val tab = util.addTable[(Int, Long, String)]("Table3",'a, 'b, 'c)
+
+    // Test aggregates
+    try {
 
 Review comment:
   Separate those test cases. Use `expected=Exception` annotation.

----------------------------------------------------------------
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

Reply via email to