View Options

Description

The option list allows you to set view options such as a label and an expiration time. You can include multiple options using a comma-separated list. (BigQuery SQL Language Reference View Options)

Grammar Syntax

OPTIONS(view_option_list [,...])

view_option_list :=
  NAME = value
NAME
Value
Supported

expiration_timestamp

TIMESTAMP

friendly_name

STRING

description

STRING

labels

ARRAY<STRUCT<STRING, STRING>>

privacy_policy

JSON-formatted STRING

Sample Source Patterns

Description & Friendly_name:

The description and friendly_name options are include into the Comment Clause generated by SnowConvert .

Input Code:

IN -> BigQuery_01.sql
CREATE VIEW my_view
OPTIONS (
  description="This is a view description",
  friendly_name="my_friendly_view"
) AS
SELECT column1, column2
FROM my_table;

Output Code:

OUT -> BigQuery_01.sql
CREATE VIEW my_view
COMMENT = '{ "description": "This is a view description", "friendly_name": "my_friendly_view", "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "bigquery",  "convertedOn": "03/25/2025",  "domain": "test" }}'
AS
SELECT column1, column2
FROM
 my_table;

Labels:

In BigQuery the labels associated with a view can be used to organize and group tables in the database administrative environment, in Snowflake the Tags can be used for the same functionality. But to ensure that the tag exists, SnowConvert will add the corresponding CREATE TAG before the CREATE VIEW if it contains labels. It is important to know that the CREATE TAG feature requires Enterprise Edition or higher

Input Code:

IN -> BigQuery_01.sql
CREATE VIEW my_view 
OPTIONS(
    labels=[("label1", "value1"), ("label2", "value2")]
)
AS
SELECT column1, column2
FROM table1;

Output Code:

OUT -> BigQuery_01.sql
CREATE TAG IF NOT EXISTS "label1";
CREATE TAG IF NOT EXISTS "label2";

CREATE VIEW my_view
WITH TAG( "label1" = "value1","label2" = "value2" )
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "bigquery",  "convertedOn": "03/26/2025",  "domain": "test" }}'
AS
SELECT column1, column2
FROM
  table1;

Unsupported Options:

When an option clause includes elements not supported by Snowflake, An EWI will be added.

Input Code:

IN -> BigQuery_01.sql
CREATE VIEW my_view
OPTIONS (
  expiration_timestamp=TIMESTAMP "2026-01-01 00:00:00 UTC",
  privacy_policy='{"aggregation_threshold_policy": {"threshold": 50, "privacy_unit_columns": "ID"}}'
) AS
SELECT column1, column2
FROM my_table;

Output Code:

OUT -> BigQuery_01.sql
CREATE VIEW my_view10
!!!RESOLVE EWI!!! /*** SSC-EWI-BQ0001 - SNOWFLAKE DOES NOT SUPPORT THE OPTIONS: EXPIRATION_TIMESTAMP, PRIVACY_POLICY ***/!!!
OPTIONS(
  expiration_timestamp=TIMESTAMP "2026-01-01 00:00:00 UTC",
  privacy_policy='{"aggregation_threshold_policy": {"threshold": 50, "privacy_unit_columns": "ID"}}'
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "bigquery",  "convertedOn": "03/26/2025",  "domain": "test" }}'
AS
SELECT column1, column2
FROM
  my_table;

Known Issues

  • The label-to-tag transformation could lead to errors if the Snowflake account is not Enterprise Edition or higher.

  1. SSC-EWI-BQ0001: The OPTIONS clause within View is not supported in Snowflake.

Last updated