SEMANTIC_RELATIONSHIPS view

This Information Schema view displays a row for each relationship in a semantic view in the specified (or current) database.

See also:

SEMANTIC_RELATIONSHIPS view (Account Usage)

Columns

Column name

Data type

Description

semantic_view_catalog

VARCHAR

Database to which the semantic view belongs.

semantic_view_schema

VARCHAR

Schema to which the semantic view belongs.

semantic_view_name

VARCHAR

Name of the semantic view.

name

VARCHAR

Name of the semantic relationship.

table_name

VARCHAR

Name of the semantic table referencing the other table.

foreign_keys

ARRAY(VARCHAR)

List of the names of the columns referring to the columns of the other table.

ref_table_name

VARCHAR

Name of the semantic table being referenced.

ref_keys

ARRAY(VARCHAR)

List of the names of the columns being referenced.

If the ASOF keyword was specified for a column in the REFERENCES clause, the element for the column is a JSON object that contains the following fields:

  • column: Name of the column.

  • type: ASOF.

For example, for this RELATIONSHIPS clause:

RELATIONSHIPS (
  customer_address(ca_cust_id)
    REFERENCES customer,
  orders(o_cust_id, o_ord_date)
    REFERENCES
    customer_address(
      ca_cust_id,
      ASOF ca_start_date
    )
)
Copy

The ref_keys column contains the following two rows:

+--------------------------------+
| REF_KEYS                       |
|--------------------------------|
| [                              |
|   "C_CUST_ID"                  |
| ]                              |
| [                              |
|   "CA_CUST_ID",                |
|   {                            |
|     "column": "CA_START_DATE", |
|     "type": "ASOF"             |
|   }                            |
| ]                              |
+--------------------------------+