twalthr commented on a change in pull request #8404: [FLINK-11476][table]
Create CatalogManager to manage multiple catalogs
URL: https://github.com/apache/flink/pull/8404#discussion_r285984841
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableEnvironment.java
##########
@@ -280,6 +317,54 @@
*/
void sqlUpdate(String stmt, QueryConfig config);
+ /**
+ * Gets the current default catalog name of the current session.
+ *
+ * @return The current default catalog name that is used for the path
resolution.
+ * @see TableEnvironment#useCatalog(String)
+ */
+ String getCurrentCatalog();
+
+ /**
+ * Sets the current catalog to the given value. It also sets the default
+ * database to the catalog's default one. To assign both catalog and
database explicitly
+ * see {@link TableEnvironment#useDatabase(String, String)}.
+ *
+ * <p>This is used during the resolution of object paths. The default
path is constructed as
+ * {@code [current-catalog].[current-database]}. During the resolution,
first we try to look for
+ * {@code [default-path].[object-path]} if no object is found we assume
the object path is a fully
+ * qualified one and we look under {@code [object-path]}.
+ *
+ * @param catalogName The name of the catalog to set as the current
default catalog.
+ * @throws CatalogException thrown if a catalog with given name could
not be set as the default one
+ */
+ void useCatalog(String catalogName);
Review comment:
Yes, I still support my comment there. For implementers of the interface, I
think it is an important information that all methods could throw a
`CatalogException` if the communication fails. But we don't need to expose it
to the user in the API.
Right now we have a binary exception structure (`ValidationException` if
user did something wrong, `TableException` if something general went wrong). It
should serve most use cases.
----------------------------------------------------------------
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