Description

The SHOW SCHEMAS statement is designed to display a list of all schemas in the current workspace. Users can view relevant schemas based on specific schemas or conditions through flexible filtering criteria. Additionally, using the EXTENDED keyword can provide more detailed information about each schema, such as its type (MANAGED or EXTERNAL).

Syntax

SHOW SCHEMAS [EXTENDED] [LIKE 'pattern' | WHERE expr];

Parameter Details

  • LIKE pattern: This parameter supports filtering output results through pattern matching. The matching is case-insensitive and supports SQL wildcards % (representing any number of characters) and _ (representing any single character). For example, LIKE '%report%' will filter out all SCHEMA names that contain the string "report". Note that the LIKE clause is mutually exclusive with the WHERE clause and cannot be used simultaneously.
  • EXTENDED: When using this keyword, the command will return additional columns with extra information, such as the type column that shows the SCHEMA type, which helps users understand the attributes of each SCHEMA.
  • WHERE expr: This parameter allows users to perform more detailed filtering based on the fields displayed by the SHOW SCHEMAS command to find SCHEMAS that meet specific conditions.

Example

Here are some usage examples of the SHOW SCHEMAS command:

  1. View all SCHEMAS in the current workspace:
    SHOW SCHEMAS;
  2. Get all MANAGED type SCHEMAs and their detailed information:
    SHOW SCHEMAS EXTENDED WHERE type='MANAGED';
  3. If you need to find a specific SCHEMA name, you can use the WHERE clause to filter by SCHEMA name:
    SHOW SCHEMAS WHERE SCHEMA_NAME='your_schema_name';

Permission Requirements

In order to execute the SHOW SCHEMAS command, the user must have the READ METADATA permission for the corresponding SCHEMA.