COLUMN DEFINITION

The table's schema information

Grammar syntax

column :=
  column_name column_schema

column_schema :=
   {
     simple_type
     | STRUCT<field_list>
     | ARRAY<array_element_schema>
   }
   [PRIMARY KEY NOT ENFORCED | REFERENCES table_name(column_name) NOT ENFORCED]
   [DEFAULT default_expression]
   [NOT NULL]
   [OPTIONS(column_option_list)]

simple_type :=
  { data_type | STRING COLLATE collate_specification }

field_list :=
  field_name column_schema [, ...]

array_element_schema :=
  { simple_type | STRUCT<field_list> }
  [NOT NULL]

For more information, please refer to BigQuery Column Definitionarrow-up-right.


Data types

Click here for more information about the translation spec for data types. Also see more information about data types in BigQuery herearrow-up-right.


Primary Key Not Enforced

circle-check

Sample Source


References Not Enforced

circle-check

Sample Source


Default default_expression

The default value assigned to the column. For more information, please refer to specify default column values.arrow-up-right

circle-check

Sample Source


Not null

When the NOT NULL constraint is present for a column or field, the column or field is created with REQUIRED mode. Conversely, when the NOT NULL constraint is absent, the column or field is created with NULLABLE mode.

circle-check

Sample Source


Options

For more information, please refer to Column Option Listarrow-up-right.

triangle-exclamation

Sample Source


String Collate

Supported grammar in Snowflake with a minor change in the separation of the language_tag and the collation_attribute. In Snowflake you must use hyphen (-) as separator instead of the colon (:).

For more information, please refer to Default collate specificationarrow-up-right.

circle-check

Sample Source


  1. MSC-BQ0001arrow-up-right: The Create Table OPTIONS clause is not supported in Snowflake.

Last updated

Was this helpful?