Github user beyond1920 commented on a diff in the pull request:
https://github.com/apache/flink/pull/3409#discussion_r106368888
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
---
@@ -353,19 +388,48 @@ abstract class TableEnvironment(val config:
TableConfig) {
* The table to scan must be registered in the [[TableEnvironment]]'s
catalog.
*
* @param tableName The name of the table to scan.
- * @throws ValidationException if no table is registered under the
given name.
+ * @throws TableException if no table is registered under the given
name.
* @return The scanned table.
*/
@throws[ValidationException]
def scan(tableName: String): Table = {
if (isRegistered(tableName)) {
- new Table(this, CatalogNode(tableName, getRowType(tableName)))
+ new Table(this, CatalogNode(getRowType(tableName), tableName))
} else {
throw new TableException(s"Table \'$tableName\' was not found in the
registry.")
}
}
/**
+ * Scans a table from registered external catalog and returns the
resulting [[Table]].
+ *
+ * @param catalogName The name of the catalog to look-up for the table.
+ * @param dbName The database name of the table to scan.
+ * @param tableName The table name to scan.
+ * @throws ExternalCatalogNotExistException if no catalog is registered
under the given name.
+ * @throws TableException if no database/ table is
found in the given catalog.
+ * @return The scanned table.
+ */
+ @throws[ExternalCatalogNotExistException]
+ @throws[TableException]
+ def scan(catalogName: String, dbName: String, tableName: String): Table
= {
--- End diff --
Good suggestion.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---