twalthr commented on a change in pull request #8521: [FLINK-12601][table] Make
the DataStream & DataSet conversion to a Table independent from Calcite
URL: https://github.com/apache/flink/pull/8521#discussion_r289281141
##########
File path:
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/TableEnvImpl.scala
##########
@@ -446,24 +420,57 @@ abstract class TableEnvImpl(
catalogManager.setCurrentDatabase(databaseName)
}
- /**
- * Registers an internal [[TableSource]] in this [[TableEnvironment]]'s
catalog without
- * name checking. Registered tables can be referenced in SQL queries.
- *
- * @param name The name under which the [[TableSource]] is
registered.
- * @param tableSource The [[TableSource]] to register.
- */
+ override def registerTable(name: String, table: Table): Unit = {
+
+ // check that table belongs to this table environment
+ if (table.asInstanceOf[TableImpl].tableEnv != this) {
+ throw new TableException(
+ "Only tables that belong to this TableEnvironment can be registered.")
+ }
+
+ checkValidTableName(name)
+
+ val tableTable = new
TableOperationCatalogView(table.asInstanceOf[TableImpl].getTableOperation)
Review comment:
no casting required
----------------------------------------------------------------
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