After you create a catalog, you can view the information about the catalog by using SQL statements.
View the statement used to create the catalog
You can execute the SHOW CREATE CATALOG external_catalog_name; statement to view the statement used to create the catalog.
Here is an example:
obclient> SHOW CREATE CATALOG test_odps_catalog;
View the catalogs in the current tenant
You can execute the SHOW CATALOGS; statement to view the catalogs in the current tenant.
Here is an example:
obclient> SHOW CATALOGS;
Query data in a catalog
You can execute arbitrary queries in a catalog as you do in a database. You can also join tables in different catalogs.
Here is an example:
obclient> SELECT * FROM internal.test.t1, odps_catalog.default.t1;
Switch catalogs
You can execute the SET CATALOG catalog_name; statement to switch to the specified catalog.
You can also execute the USE internal.test; or USE odps_catalog.default statement to switch to the 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;