rmoff
01/26/2024, 2:09 PMSHOW CATALOGS but from the docs it doesn't look like there is an equivalent DESCRIBE, is that right? is there any way to find out, from without a SQL Client session, information about a catalog? Or do I just have to go back to the CREATE CATALOG statement?
edit: I found https://cwiki.apache.org/confluence/display/FLINK/FLIP-69%3A+Flink+SQL+DDL+Enhancement and associated https://issues.apache.org/jira/browse/FLINK-14689 with https://github.com/apache/flink/blob/master/flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/dql/SqlDescribeCatalog.java in the code today -- so DESCRIBE CATALOG should work? But on 1.18.1 it doesn't:
Flink SQL> SHOW CATALOGS;
+-----------------+
| catalog name |
+-----------------+
| c_new |
| default_catalog |
+-----------------+
2 rows in set
Flink SQL> DESCRIBE CATALOG default_catalog;
[ERROR] Could not execute SQL statement. Reason:
org.apache.calcite.sql.validate.SqlValidatorException: Column 'default_catalog' not found in any tableTim Wolfe
01/30/2024, 2:59 PMSHOW CATALOGS command is indeed a way to list all available catalogs in your session. However, the DESCRIBE CATALOG functionality you're referring to isn't part of the standard commands available in Flink SQL as of the versions up to 1.18.1, which you're using.
The confusion might stem from the FLIP-69 you found, which proposes enhancements to Flink's SQL DDL capabilities, including the introduction of commands like DESCRIBE CATALOG. However, even though there might be code snippets or discussions around it, it doesn't necessarily mean that the feature has been fully implemented and made available in a stable release.
To get information about a catalog, you typically have to refer back to the CREATE CATALOG statement or the configuration of Flink where the catalog is defined. This could be in your Flink SQL client environment, a configuration file, or the code where you set up your Flink application.
If you're looking for detailed metadata about tables, databases, or other objects within a catalog, you can use commands like SHOW DATABASES in the catalog context, SHOW TABLES to list tables in the current database, and DESCRIBE or DESCRIBE TABLE to get details about a table's schema.
For your specific case, since DESCRIBE CATALOG isn't working, I'd recommend sticking to these other commands for exploring the objects within your catalogs and databases. If you need more detailed information about the catalog itself, you might need to check the catalog's documentation or the configuration files where it's defined.rmoff
01/30/2024, 3:28 PM