A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/sql/show-semantic-dimensions below:

Website Navigation


SHOW SEMANTIC DIMENSIONS | Snowflake Documentation

SHOW SEMANTIC DIMENSIONS

Lists the dimensions in the semantic views for which you have access privileges.

You can use this command to list objects in the current database and schema for the session, a specified database or schema, or your entire account.

The output includes the metadata and properties for each object. The objects are sorted lexicographically by database, schema, and object name (see Output in this topic for descriptions of the output columns). The order is important to note if you want to filter the results.

See also:

CREATE SEMANTIC VIEW , ALTER SEMANTIC VIEW , DESCRIBE SEMANTIC VIEW , DROP SEMANTIC VIEW , SHOW SEMANTIC VIEWS , SHOW SEMANTIC METRICS , SHOW SEMANTIC DIMENSIONS FOR METRIC

Syntax
SHOW SEMANTIC DIMENSIONS [ LIKE '<pattern>' ]
                         [ IN
                              {
                                <semantic_view_name>     |

                                ACCOUNT                  |

                                DATABASE                 |
                                DATABASE <database_name> |

                                SCHEMA                   |
                                SCHEMA <schema_name>
                              }
                         ]
                         [ STARTS WITH '<name_string>' ]
                         [ LIMIT <rows> ]

Copy

Parameters
LIKE 'pattern'

Optionally filters the command output by object name. The filter uses case-insensitive pattern matching, with support for SQL wildcard characters (% and _).

For example, the following patterns return the same results:

... LIKE '%testing%' ...

... LIKE '%TESTING%' ...

. Default: No value (no filtering is applied to the output).

[ IN ... ]

Optionally specifies the scope of the command. Specify one of the following:

semantic_view_name

Returns records for the specified semantic view.

ACCOUNT

Returns records for the entire account.

DATABASE, . DATABASE db_name

Returns records for the current database in use or for a specified database (db_name).

If you specify DATABASE without db_name and no database is in use, the keyword has no effect on the output.

SCHEMA, . SCHEMA database_name.schema_name

Returns records for the current schema in use or a specified schema (database_name.schema_name).

If no database is in use, specifying SCHEMA has no effect on the output.

Default: Depends on whether the session currently has a database in use:

STARTS WITH 'name_string'

Optionally filters the command output based on the characters that appear at the beginning of the object name. The string must be enclosed in single quotes and is case sensitive.

For example, the following strings return different results:

... STARTS WITH 'B' ...

... STARTS WITH 'b' ...

. Default: No value (no filtering is applied to the output)

LIMIT rows

Optionally limits the maximum number of rows returned. The actual number of rows returned might be less than the specified limit. For example, the number of existing objects is less than the specified limit.

Default: No value (no limit is applied to the output).

Output

The output of the command includes the following columns, which describe the properties and metadata of the object:

Column

Description

database_name

Name of the database that contains the semantic view.

schema_name

Name of the schema that contains the semantic view.

semantic_view_name

Name of the semantic view that contains the dimension.

table_name

Name of the base table for the dimension.

name

Name of the dimension.

data_type

Data type of the dimension.

synonyms

Alternative names or synonyms for the dimension.

comment

Comment about the dimension.

Access control requirements

A role used to execute this SQL command must have at least one of the following privileges at a minimum:

Privilege

Object

Notes

Any

Semantic view

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes Examples

The following example lists the dimensions for semantic views that you have any privilege on. The list includes dimensions in semantic views in the current schema of the current database.

SHOW SEMANTIC DIMENSIONS;

Copy

+---------------+-------------+--------------------+------------+-------------------------+-------------+-------------------+--------------------------------+
| database_name | schema_name | semantic_view_name | table_name | name                    | data_type   | synonyms          | comment                        |
|---------------+-------------+--------------------+------------+-------------------------+-------------+-------------------+--------------------------------|
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | CUSTOMER   | CUSTOMER_COUNTRY_CODE   | VARCHAR(15) | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | CUSTOMER   | CUSTOMER_MARKET_SEGMENT | VARCHAR(10) | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | CUSTOMER   | CUSTOMER_NAME           | VARCHAR(25) | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | CUSTOMER   | CUSTOMER_NATION_NAME    | VARCHAR(25) | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | CUSTOMER   | CUSTOMER_REGION_NAME    | VARCHAR(25) | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | NATION     | NATION_NAME             | VARCHAR(25) | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_ANALYSIS      | ORDERS     | ORDER_DATE              | DATE        | NULL              | NULL                           |
| MY_DB         | MY_SCHEMA   | TPCH_REV_ANALYSIS  | CUSTOMERS  | CUSTOMER_NAME           | VARCHAR(25) | ["customer name"] | Name of the customer           |
| MY_DB         | MY_SCHEMA   | TPCH_REV_ANALYSIS  | ORDERS     | ORDER_DATE              | DATE        | NULL              | Date when the order was placed |
| MY_DB         | MY_SCHEMA   | TPCH_REV_ANALYSIS  | ORDERS     | ORDER_YEAR              | NUMBER(4,0) | NULL              | Year when the order was placed |
+---------------+-------------+--------------------+------------+-------------------------+-------------+-------------------+--------------------------------+

The following example lists the dimensions for the semantic view named tpch_rev_analysis in the current schema of the current database:

SHOW SEMANTIC DIMENSIONS IN tpch_rev_analysis;

Copy

+---------------+-------------+--------------------+------------+---------------+-------------+-------------------+--------------------------------+
| database_name | schema_name | semantic_view_name | table_name | name          | data_type   | synonyms          | comment                        |
|---------------+-------------+--------------------+------------+---------------+-------------+-------------------+--------------------------------|
| MY_DB         | MY_SCHEMA   | TPCH_REV_ANALYSIS  | CUSTOMERS  | CUSTOMER_NAME | VARCHAR(25) | ["customer name"] | Name of the customer           |
| MY_DB         | MY_SCHEMA   | TPCH_REV_ANALYSIS  | ORDERS     | ORDER_DATE    | DATE        | NULL              | Date when the order was placed |
| MY_DB         | MY_SCHEMA   | TPCH_REV_ANALYSIS  | ORDERS     | ORDER_YEAR    | NUMBER(4,0) | NULL              | Year when the order was placed |
+---------------+-------------+--------------------+------------+---------------+-------------+-------------------+--------------------------------+

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4