hequn8128 commented on a change in pull request #6236: [FLINK-9699] [table] Add 
api to replace registered table
URL: https://github.com/apache/flink/pull/6236#discussion_r241972719
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ##########
 @@ -526,19 +545,34 @@ abstract class TableEnvironment(val config: TableConfig) 
{
 
     checkValidTableName(name)
     val tableTable = new RelTable(table.getRelNode)
-    registerTableInternal(name, tableTable)
+    registerTableInternal(name, tableTable, true)
   }
 
+
   /**
     * Registers an external [[TableSource]] in this [[TableEnvironment]]'s 
catalog.
     * Registered tables can be referenced in SQL queries.
     *
     * @param name        The name under which the [[TableSource]] is 
registered.
     * @param tableSource The [[TableSource]] to register.
     */
-  def registerTableSource(name: String, tableSource: TableSource[_]): Unit = {
+  def registerTableSource(name: String,
+                          tableSource: TableSource[_]): Unit = {
     checkValidTableName(name)
-    registerTableSourceInternal(name, tableSource)
+    registerTableSourceInternal(name, tableSource, false)
+  }
+
+  /**
+    * Registers or replace an external [[TableSource]] in this 
[[TableEnvironment]]'s catalog.
+    * Registered tables can be referenced in SQL queries.
+    *
+    * @param name        The name under which the [[TableSource]] is 
registered.
+    * @param tableSource The [[TableSource]] to register.
+    */
+  def registerOrReplaceTableSource(name: String,
 
 Review comment:
   Format the code to be consistent with old functions

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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