Categories:

Information Schema , Table Functions

TAG_REFERENCES

Returns a table in which each row displays an association between a tag and value.

The associated tag and value are the result of a direct association to an object or through tag lineage.

Syntax

TAG_REFERENCES( '<object_name>' , '<object_domain>' )

Arguments

'object_name'

Name of the referenced object if the tag association is on the object.

'object_domain'

Domain of the reference object (e.g. table, view) if the tag association is on the object. For columns, the domain is COLUMN if the tag association is on a column.

Usage Notes

  • Results are only returned for a role that has access to the specified object.

  • When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function must use the fully-qualified object name. For more details, see Information Schema.

Output

The function returns the following columns:

Column

Data Type

Description

TAG_DATABASE

TEXT

The database in which the tag is set.

TAG_SCHEMA

TEXT

The schema in which the tag is set.

TAG_NAME

TEXT

The name of the tag. This is the key in the key = 'value' pair of the tag.

TAG_VALUE

TEXT

The value of the tag. This is the 'value' in the key = 'value' pair of the tag.

LEVEL

TEXT

The object domain on which the tag is set.

OBJECT_DATABASE

TEXT

Database name of the referenced object for database and schema objects. If the object is not a database or schema object, the value is empty.

OBJECT_SCHEMA

TEXT

Schema name of the referenced object (for schema objects). If the referenced object is not a schema object (e.g. warehouse), this value is empty.

OBJECT_NAME

TEXT

Name of the reference object if the tag association is on the object.

DOMAIN

TEXT

Domain of the reference object (e.g. table, view) if the tag association is on the object. If the tag association is on a column, the domain is COLUMN.

COLUMN_NAME

TEXT

Name of the referenced column; not applicable if the tag association is not a column.

Examples

Retrieve the list of tags associated with the table my_table:

select *
  from table(my_db.information_schema.tag_references('my_table', 'table'));

Retrieve the list of tags associated on the column result:

select *
  from table(my_db.information_schema.tag_references('my_table.result', 'COLUMN'));