After creating a catalog, you can use SQL statements to view information about it.
View the statement used to create a catalog
You can use the SHOW CREATE CATALOG external_catalog_name; statement to view the creation statement of a catalog.
Notice
For security reasons, sensitive attributes in the creation statement (such as ODPS's ACCESSID, ACCESSKEY, STSTOKEN, and JDBC's URL) are masked.
Example:
obclient> SHOW CREATE CATALOG test_jdbc_catalog;
View catalogs visible to the current user
You can use the SHOW CATALOGS; statement to view the catalogs visible to the current user.
Note
Catalogs for which the current user does not have the USE CATALOG privilege will not appear in the results.
Example:
obclient> SHOW CATALOGS;
View the current catalog
You can use the CURRENT_CATALOG() or CATALOG() function to view the catalog of the current session.
Example:
obclient> SELECT CURRENT_CATALOG() FROM dual;
View data in a catalog
In a catalog, you can perform query operations just like on tables within a database, and you can also perform cross-catalog join queries.
Example:
Access an external table directly using the three-part naming convention (catalog name.schema name.table name).
SELECT * FROM test_jdbc_catalog.dbo.table_name;Cross-Catalog joint query.
SELECT * FROM internal.system.test_t1, test_odps_catalog.project_name.test_t1;
Catalog switching
You can use the SET CATALOG catalog_name; statement to switch Catalogs. For more information, see SET CATALOG.
Examples:
Switch to the internal system Catalog.
obclient> SET CATALOG internal;Switch to an external Catalog.
obclient> SET CATALOG test_jdbc_catalog;