catalog
Returns the name of the current catalog. The catalog can be a StarRocks internal catalog or an external catalog that is mapped to an external data source. For more information about catalogs, see Catalog overview.
If no catalog is selected, the StarRocks internal catalog default_catalog
is returned.
Syntaxβ
catalog()
Parametersβ
This function does not require parameters.
Return valueβ
Returns the name of the current catalog as a string.
Examplesβ
Example 1: The current catalog is StarRocks internal catalog default_catalog
.
select catalog();
+-----------------+
| CATALOG() |
+-----------------+
| default_catalog |
+-----------------+
1 row in set (0.01 sec)
Example 2: The current catalog is an external catalog hudi_catalog
.
-- Switch to an external catalog.
set catalog hudi_catalog;
-- Return the name of the current catalog.
select catalog();
+--------------+
| CATALOG() |
+--------------+
| hudi_catalog |
+--------------+
See alsoβ
SET CATALOG: Switches to a destination catalog.