Hi. Quick question: it seems catalogs entries are ...
# random
c
Hi. Quick question: it seems catalogs entries are flushed when the session is closed (the entries as shown in SHOW CATALOGS, not the catalog tables which can be stored in DB/HDFS/etc..). Is that always the case ? Or can the catalog configs be stored somewhere and shared between sessions ?
m
You can store them. Out of the box, there is integration with the Hive Metastore. You can also build your own. See https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/catalogs/
c
IIUC this stores the content of the catalog but not the info that is put in the
CREATE CATALOG
command
If in session 1, I do:
Copy code
CREATE CATALOG foo {...};
SHOW catalogs;
+-----------------+
|    catalog name |
+-----------------+
| default_catalog |
|             foo |
+-----------------+
2 rows in set
In session 2, we don't see the foo catalog:
Copy code
SHOW CATALOGS;
+-----------------+
|    catalog name |
+-----------------+
| default_catalog |
+-----------------+
1 row in set
m
Do you mean something like how can I load multiple catalogs during the start of your SQL client session?
c
Yes. And R/W them to a storage
m
I think right now you can either initialize your session with an initialization SQL statement, like described at https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sqlclient/#initialize-session-using-sql-files and I think with the SQL Gateway you can also configure your session (not sure 100% on the latter, but basing this off https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql-gateway/rest/#sessions-session_handle-configure-session)
But I don't think the SQL Gateway yet allows you to store this in a database or something
c
OK. So this is something that has to be configured. Actually that's a good thing for my use case πŸ˜€. I want session2 to have absolutely no possibility of using catalog foo !
I think you're looking for https://issues.apache.org/jira/browse/FLINK-31259
Thanks. That clarifies things a lot.
Currently each
Session
in gateway has its own
CatalogManager
This is perfect.