TABLE_OPTIONS view
TheINFORMATION_SCHEMA.TABLE_OPTIONS view contains one row for each option,for each table or view in a dataset. TheTABLESandTABLE_OPTIONS views also contain high-level information about views.For detailed information, query theINFORMATION_SCHEMA.VIEWS view.
Required permissions
To query theINFORMATION_SCHEMA.TABLE_OPTIONS view, you need the followingIdentity and Access Management (IAM) permissions:
bigquery.tables.getbigquery.tables.listbigquery.routines.getbigquery.routines.list
Each of the following predefined IAM roles includes the precedingpermissions:
roles/bigquery.adminroles/bigquery.dataViewerroles/bigquery.metadataViewer
For more information about BigQuery permissions, seeAccess control with IAM.
Schema
When you query theINFORMATION_SCHEMA.TABLE_OPTIONS view, the query resultscontain one row for each option, for each table or view in a dataset. Fordetailed information aboutviews, query theINFORMATION_SCHEMA.VIEWS viewinstead.
TheINFORMATION_SCHEMA.TABLE_OPTIONS view has the following schema:
| Column name | Data type | Value |
|---|---|---|
table_catalog | STRING | The project ID of the project that contains the dataset |
table_schema | STRING | The name of the dataset that contains the table or view also referred to as thedatasetId |
table_name | STRING | The name of the table or view also referred to as thetableId |
option_name | STRING | One of the name values in theoptions table |
option_type | STRING | One of the data type values in theoptions table |
option_value | STRING | One of the value options in theoptions table |
Options table
|
|
|
|---|---|---|
|
| A description of the table |
|
| Whether automatic refresh is enabled for a materialized view |
|
| The time when this table expires |
|
| The table's descriptive name |
|
| The name of the Cloud KMS key used to encrypt the table |
|
| An array ofSTRUCT's that represent the labels on the table |
|
| The configured table's maximum staleness forBigQuery change data capture (CDC) upserts |
|
| The default lifetime, in days, of all partitions in a partitioned table |
|
| How frequently a materialized view is refreshed |
|
| Whether queries over the table require a partition filter |
|
| Tags attached to a table in a namespaced <key, value> syntax. For more information, seeTags and conditional access. |
For external tables, the following options are possible:
| Options | |
|---|---|
allow_jagged_rows |
If Applies to CSV data. |
allow_quoted_newlines |
If Applies to CSV data. |
bigtable_options |
Only required when creating a Bigtable external table. Specifies the schema of the Bigtable external table in JSON format. For a list of Bigtable table definition options, see |
column_name_character_map |
Defines the scope of supported column name characters and the handling behavior of unsupported characters. The default setting is Supported values include:
Applies to CSV and Parquet data. |
compression |
The compression type of the data source. Supported values include: Applies to CSV and JSON data. |
decimal_target_types |
Determines how to convert a Example: |
description |
A description of this table. |
enable_list_inference |
If Applies to Parquet data. |
enable_logical_types |
If Applies to Avro data. |
encoding |
The character encoding of the data. Supported values include: Applies to CSV data. |
enum_as_string |
If Applies to Parquet data. |
expiration_timestamp |
The time when this table expires. If not specified, the table does not expire. Example: |
field_delimiter |
The separator for fields in a CSV file. Applies to CSV data. |
format |
The format of the external data. Supported values for Supported values for The value |
hive_partition_uri_prefix |
A common prefix for all source URIs before the partition key encoding begins. Applies only to hive-partitioned external tables. Applies to Avro, CSV, JSON, Parquet, and ORC data. Example: |
file_set_spec_type |
Specifies how to interpret source URIs for load jobs and external tables. Supported values include:
For example, if you have a source URI of |
ignore_unknown_values |
If Applies to CSV and JSON data. |
json_extension |
For JSON data, indicates a particular JSON interchange format. If not specified, BigQuery reads the data as generic JSON records. Supported values include: |
max_bad_records |
The maximum number of bad records to ignore when reading the data. Applies to: CSV, JSON, and Google Sheets data. |
max_staleness |
Applicable forBigLake tables andobject tables. Specifies whether cached metadata is used by operations against the table, and how fresh the cached metadata must be in order for the operation to use it. To disable metadata caching, specify 0. This is the default. To enable metadata caching, specify aninterval literal value between 30 minutes and 7 days. For example, specify |
null_marker |
The string that represents Applies to CSV data. |
null_markers |
The list of strings that represent This option cannot be used with Applies to CSV data. |
object_metadata |
Only required when creating anobject table. Set the value of this option to |
preserve_ascii_control_characters |
If Applies to CSV data. |
projection_fields |
A list of entity properties to load. Applies to Datastore data. |
quote |
The string used to quote data sections in a CSV file. If your data contains quoted newline characters, also set the Applies to CSV data. |
reference_file_schema_uri |
User provided reference file with the table schema. Applies to Parquet/ORC/AVRO data. Example: |
require_hive_partition_filter |
If Applies to Avro, CSV, JSON, Parquet, and ORC data. |
sheet_range |
Range of a Google Sheets spreadsheet to query from. Applies to Google Sheets data. Example: |
skip_leading_rows |
The number of rows at the top of a file to skip when reading the data. Applies to CSV and Google Sheets data. |
source_column_match |
This controls the strategy used to match loaded columns to the schema. If this value is unspecified, then the default is based on how the schema is provided. If autodetect is enabled, then the default behavior is to match columns by name. Otherwise, the default is to match columns by position. This is done to keep the behavior backward-compatible. Supported values include:
|
tags | <ARRAY<STRUCT<STRING, STRING>>>An array of IAM tags for the table, expressed as key-value pairs. The key should be thenamespaced key name, and the value should be theshort name. |
time_zone |
Default time zone that will apply when parsing timestamp values that have no specific time zone. Checkvalid time zone names. If this value is not present, the timestamp values without specific time zone is parsed using default time zone UTC. Applies to CSV and JSON data. |
date_format |
Format elements that define how the DATE values are formatted in the input files (for example, If this value is present, this format is the only compatible DATE format.Schema autodetection will also decide DATE column type based on this format instead of the existing format. If this value is not present, the DATE field is parsed with thedefault formats. Applies to CSV and JSON data. |
datetime_format |
Format elements that define how the DATETIME values are formatted in the input files (for example, If this value is present, this format is the only compatible DATETIME format.Schema autodetection will also decide DATETIME column type based on this format instead of the existing format. If this value is not present, the DATETIME field is parsed with thedefault formats. Applies to CSV and JSON data. |
time_format |
Format elements that define how the TIME values are formatted in the input files (for example, If this value is present, this format is the only compatible TIME format.Schema autodetection will also decide TIME column type based on this format instead of the existing format. If this value is not present, the TIME field is parsed with thedefault formats. Applies to CSV and JSON data. |
timestamp_format |
Format elements that define how the TIMESTAMP values are formatted in the input files (for example, If this value is present, this format is the only compatible TIMESTAMP format.Schema autodetection will also decide TIMESTAMP column type based on this format instead of the existing format. If this value is not present, the TIMESTAMP field is parsed with thedefault formats. Applies to CSV and JSON data. |
uris | For external tables, including object tables, that aren't Bigtable tables:
An array of fully qualified URIs for the external data locations. Each URI can contain one asterisk ( The following examples show valid
For Bigtable tables:
The URI identifying the Bigtable table to use as a data source. You can only specify one Bigtable URI. Example: For more information on constructing a Bigtable URI, seeRetrieve the Bigtable URI. |
For stability, we recommend that you explicitly list columns in your information schema queries instead ofusing a wildcard (SELECT *). Explicitly listing columns prevents queries frombreaking if the underlying schema changes.
Scope and syntax
Queries against this view must include a dataset or a region qualifier. Forqueries with a dataset qualifier, you must have permissions for the dataset.For queries with a region qualifier, you must have permissions for the project.For moreinformation seeSyntax.The following table explains the region and resource scopes for this view:
| View name | Resource scope | Region scope |
|---|---|---|
[PROJECT_ID.]`region-REGION`.INFORMATION_SCHEMA.TABLE_OPTIONS | Project level | REGION |
[PROJECT_ID.]DATASET_ID.INFORMATION_SCHEMA.TABLE_OPTIONS | Dataset level | Dataset location |
- Optional:
PROJECT_ID: the ID of your Google Cloud project. If not specified, the default project is used. REGION: anydataset region name. For example,`region-us`.DATASET_ID: the ID of your dataset. For more information, seeDataset qualifier.Note: You must usea region qualifier to query
INFORMATION_SCHEMAviews. The location of the query execution must match the region of theINFORMATION_SCHEMAview.
Example
Example 1:
The following example retrieves the default table expiration times for alltables inmydataset in your default project (myproject) by querying theINFORMATION_SCHEMA.TABLE_OPTIONS view.
To run the query against a project other than your default project, add theproject ID to the dataset in the following format:`project_id`.dataset.INFORMATION_SCHEMA.view;for example,`myproject`.mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS.
INFORMATION_SCHEMA view names are case-sensitive.SELECT*FROMmydataset.INFORMATION_SCHEMA.TABLE_OPTIONSWHEREoption_name='expiration_timestamp';
The result is similar to the following:
+----------------+---------------+------------+----------------------+-------------+--------------------------------------+ | table_catalog | table_schema | table_name | option_name | option_type | option_value | +----------------+---------------+------------+----------------------+-------------+--------------------------------------+ | myproject | mydataset | mytable1 | expiration_timestamp | TIMESTAMP | TIMESTAMP "2020-01-16T21:12:28.000Z" | | myproject | mydataset | mytable2 | expiration_timestamp | TIMESTAMP | TIMESTAMP "2021-01-01T21:12:28.000Z" | +----------------+---------------+------------+----------------------+-------------+--------------------------------------+
Example 2:
The following example retrieves metadata about all tables inmydataset thatcontain test data. The query uses the values in thedescription option to findtables that contain "test" anywhere in the description.mydataset is in yourdefault project —myproject.
To run the query against a project other than your default project, add theproject ID to the dataset in the following format:`project_id`.dataset.INFORMATION_SCHEMA.view;for example,`myproject`.mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS.
SELECT*FROMmydataset.INFORMATION_SCHEMA.TABLE_OPTIONSWHEREoption_name='description'ANDoption_valueLIKE'%test%';
The result is similar to the following:
+----------------+---------------+------------+-------------+-------------+--------------+ | table_catalog | table_schema | table_name | option_name | option_type | option_value | +----------------+---------------+------------+-------------+-------------+--------------+ | myproject | mydataset | mytable1 | description | STRING | "test data" | | myproject | mydataset | mytable2 | description | STRING | "test data" | +----------------+---------------+------------+-------------+-------------+--------------+
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.