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_r241972708
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ##########
 @@ -517,7 +518,25 @@ abstract class TableEnvironment(val config: TableConfig) {
     * @param table The table to register.
     */
   def registerTable(name: String, table: Table): Unit = {
+    // check that table belongs to this table environment
+    if (table.tableEnv != this) {
+      throw new TableException(
+        "Only tables that belong to this TableEnvironment can be registered.")
+    }
+
+    checkValidTableName(name)
+    val tableTable = new RelTable(table.getRelNode)
+    registerTableInternal(name, tableTable, false)
+  }
 
+  /**
+    * Registers or replace a [[Table]] under a unique name in the 
TableEnvironment's catalog.
 
 Review comment:
   - Registers or replace => Registers or replaces
   - under a unique name => under a name 

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