FIELDS view

This Information Schema view displays a row for each field in a structured OBJECT type and a row for the key and value in a MAP in an object (a column in a table) in the specified (or current) database.

For MAPs, the view contains separate rows for the key and value.

Each row describes the type of the element in the structured ARRAY.

Columns

Column NameData TypeDescription
OBJECT_CATALOGVARCHARDatabase that contains the object that uses this OBJECT or MAP type.
OBJECT_SCHEMAVARCHARSchema that contains the object that uses this OBJECT or MAP type.
OBJECT_NAMEVARCHARName of the object that uses this OBJECT or MAP type (e.g. name of a table).
OBJECT_TYPEVARCHAR

Type of the object that uses this OBJECT or MAP type:

  • TABLE (if used by a column)
ROW_IDENTIFIERVARCHAR

Type identifier. Use this to join on:

  • The DTD_IDENTIFIER column in the COLUMNS view.
  • The DTD_IDENTIFIER column in the ELEMENT_TYPES view (for nested types).
  • The DTD_IDENTIFIER column in this view (for nested types).
FIELD_NAMEVARCHAR

One of the following values:

  • For structured OBJECTs, the name of the key.
  • For MAPs, KEY for the key or VALUE for the value.
ORDINAL_POSITIONNUMBER

The ordinal position of the key in the OBJECT or MAP. The position is 1-based.

For MAPs, the ordinal position of the key is 1, and the ordinal position of the value is 2.

DATA_TYPEVARCHARData type of the value (for OBJECTs) or the key or value (for MAPs).
CHARACTER_MAXIMUM_LENGTHNUMBERMaximum length in characters of string keys or values.
CHARACTER_OCTET_LENGTHNUMBERMaximum length in bytes of string keys or values.
NUMERIC_PRECISIONNUMBERNumeric precision of numeric keys or values.
NUMERIC_PRECISION_RADIXNUMBERRadix of precision of numeric keys or values.
NUMERIC_SCALENUMBERScale of numeric keys or values.
DATETIME_PRECISIONNUMBERNot applicable for Snowflake.
INTERVAL_TYPEVARCHARNot applicable for Snowflake.
INTERVAL_PRECISIONNUMBERNot applicable for Snowflake.
CHARACTER_SET_CATALOGVARCHARNot applicable for Snowflake.
CHARACTER_SET_SCHEMAVARCHARNot applicable for Snowflake.
CHARACTER_SET_NAMEVARCHARNot applicable for Snowflake.
COLLATION_CATALOGVARCHARNot applicable for Snowflake.
COLLATION_SCHEMAVARCHARNot applicable for Snowflake.
COLLATION_NAMEVARCHARThe collation specification for this keys or values.
UDT_CATALOGVARCHARNot applicable for Snowflake.
UDT_SCHEMAVARCHARNot applicable for Snowflake.
UDT_NAMEVARCHARNot applicable for Snowflake.
SCOPE_CATALOGVARCHARNot applicable for Snowflake.
SCOPE_SCHEMAVARCHARNot applicable for Snowflake.
SCOPE_NAMEVARCHARNot applicable for Snowflake.
MAXIMUM_CARDINALITYNUMBERMaximum cardinality. Currently, this is always set to NULL.
DTD_IDENTIFIERVARCHAR

Nested type identifier. Use this to join on:

  • The COLLECTION_TYPE_IDENTIFIER column in the ELEMENT_TYPES view.
  • The ROW_IDENTIFIER column in this view (for nested types).

Usage notes

  • The view only displays objects for which the current role for the session has been granted access privileges.

    The view does not honor the MANAGE GRANTS privilege and consequently may show less information compared to the SHOW COLUMNS command when both are executed by a user who holds the MANAGE GRANTS privilege.