SHOW CATALOGS

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 10.3 and above

Lists the catalogs that match an optionally supplied regular expression pattern. If no pattern is supplied then the command lists all catalogs in the metastore.

Syntax

SHOW CATALOGS [ LIKE regex_pattern ]

Parameters

  • regex_pattern

    A regular expression pattern that is used to filter the results of the statement. - Except for * and | character, the pattern works like a regular expression. - * alone matches 0 or more characters and | is used to separate multiple different regular expressions, any of which can match. - The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.

Examples

-- Create catalogs.
> CREATE CATALOG payroll_cat;
> CREATE CATALOG payments_cat;

-- Lists all the catalogs.
> SHOW CATALOGS;
 catalog
 --------------
 hive_metastore
           main
   payments_cat
    payroll_cat

-- Lists catalogs with name starting with string pattern `pay`
> SHOW CATALOGS LIKE 'pay*';
 catalog
 ------------
 payments_cat
  payroll_cat