docete commented on a change in pull request #11276: 
[FLINK-16029][table-planner-blink] Remove register source and sink in test 
cases of blink planner
URL: https://github.com/apache/flink/pull/11276#discussion_r402726288
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/TableSourceTest.scala
 ##########
 @@ -39,34 +36,23 @@ class TableSourceTest extends TableTestBase {
 
   @Before
   def setup(): Unit = {
-    util.tableEnv.registerTableSource("FilterableTable", 
TestFilterableTableSource(false))
-    TestPartitionableSourceFactory.registerTableSource(util.tableEnv, 
"PartitionableTable", false)
+    TestFilterableTableSource.createTemporaryTable(
+      util.tableEnv,
+      TestFilterableTableSource.defaultSchema,
+      "FilterableTable")
+
+    TestPartitionableSourceFactory.createTemporaryTable(util.tableEnv, 
"PartitionableTable", false)
   }
 
   @Test
   def testBoundedStreamTableSource(): Unit = {
-    util.tableEnv.registerTableSource("MyTable", new TestTableSource(true, 
tableSchema))
+    TestTableSource.createTemporaryTable(util.tableEnv, isBounded = true, 
tableSchema, "MyTable")
     util.verifyPlan("SELECT * FROM MyTable")
   }
 
   @Test
   def testUnboundedStreamTableSource(): Unit = {
-    util.tableEnv.registerTableSource("MyTable", new TestTableSource(false, 
tableSchema))
-    util.verifyPlan("SELECT * FROM MyTable")
-  }
-
-  @Test
-  def testNonStreamTableSource(): Unit = {
-    val tableSource = new TableSource[Row]() {
-
-      override def getProducedDataType: DataType = tableSchema.toRowDataType
-
-      override def getTableSchema: TableSchema = tableSchema
-    }
-    util.tableEnv.registerTableSource("MyTable", tableSource)
-    thrown.expect(classOf[ValidationException])
-    thrown.expectMessage(
-      "Only StreamTableSource and LookupableTableSource can be used in Blink 
planner.")
 
 Review comment:
   It's only used in `convertSourceTable` which convert `ConnectorCatalogTable` 
to `TableSourceTable`. When there is no registerTableSource/Sink, there is no 
`ConnectorCatalogTable` either. 

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