SET CATALOG

Switches to a specified catalog in the current session.

NOTE

You must have the USAGE privilege on the destination external catalog if you want to run SET CATALOG to switch to that catalog. You can use GRANT to grant the required privileges.

Syntax

SET CATALOG <catalog_name>

Parameter

catalog_name: the name of the catalog to use in the current session. You can switch to an internal or external catalog. If the catalog that you specify does not exist, an exception is thrown.

Examples

Run the following command to switch to a Hive catalog named hive_metastore in the current session:

SET CATALOG hive_metastore;

Run the following command to switch to the internal catalog default_catalog in the current session:

SET CATALOG default_catalog;