After you create a catalog, you can use SQL statements to view the information of the catalog.
View the creation statement of the catalog
You can use SHOW CREATE CATALOG external_catalog_name; to view the creation statement for the catalog.
Here is an example:
obclient> SHOW CREATE CATALOG test_odps_catalog;
View catalogs of the current tenant
You can use SHOW CATALOGS; to view the catalogs for the current tenant.
Here is an example:
obclient> SHOW CATALOGS;
View data in a catalog
In a catalog, you can execute queries as in a database and perform join queries across different catalogs.
Here is an example:
obclient> SELECT * FROM internal.test.t1, odps_catalog.default.t1;
Switch a catalog
You can execute the SET CATALOG catalog_name; statement to switch to a specified catalog.
You can also execute the USE internal.test; or USE odps_catalog.default; statement to switch to a specified catalog and database at the same time.
Here is an example:
Switch to the internal catalog.
obclient> SET CATALOG internal;Switch to the external catalog.
obclient> SET CATALOG external_catalog_name;