This document describes how to view the metadata for a BigQuery table
snapshot in the Trusted Cloud console, by querying the TABLE_SNAPSHOTS
view of the
INFORMATION_SCHEMA
table, by using the bq show
command, or by calling the
tables.get
API.
It is intended for users who are familiar with
BigQuery
tables and
table snapshots.
Permissions and roles
This section describes the
Identity and Access Management (IAM) permission
that you need to view the metadata for a table snapshot, and the
predefined IAM roles
that grant those permissions.
Permissions
To view a table snapshot's metadata, you need the following permission:
Permission |
Resource |
bigquery.tables.get
|
The table snapshot |
Roles
The predefined BigQuery roles that provide the required
permission are as follows:
Role |
Resource |
Any of the following:
bigquery.metadataViewer
bigquery.dataViewer
bigquery.dataEditor
bigquery.dataOwner
bigquery.admin
|
The table snapshot |
The metadata for a table snapshot is similar to the metadata for a standard
table, with the following differences:
- An additional
baseTableReference
field identifies the base table that
the snapshot was taken from.
- The
type
field has the value SNAPSHOT
.
You can view the metadata for a table snapshot by using one of the
following options:
Console
In the Trusted Cloud console, go to the BigQuery page.
Go to BigQuery
In the Explorer pane, expand the project and dataset nodes of the
table snapshot you want to look at.
Click the name of the table snapshot.
In the snapshot pane that appears, you can do the following:
Click the Schema tab to view the table snapshot's schema and
policy tags.
Click the Details table to view the table snapshot's size,
expiration, base table, snapshot time, and other information.
SQL
To see metadata for a table snapshot, query the
INFORMATION_SCHEMA.TABLE_SNAPSHOTS
view:
In the Trusted Cloud console, go to the BigQuery page.
Go to BigQuery
In the query editor, enter the following statement:
SELECT
*
FROM
PROJECT_ID.DATASET_NAME.INFORMATION_SCHEMA.TABLE_SNAPSHOTS
WHERE
table_name = 'SNAPSHOT_NAME';
Replace the following:
PROJECT_ID
: the project ID of the
project that contains the snapshot.
DATASET_NAME
: the name of the dataset
that contains the snapshot.
SNAPSHOT_NAME
: the name of the snapshot.
Click play_circle Run.
For more information about how to run queries, see Run an interactive query.
bq
Enter the following command in the Cloud Shell:
Go to Cloud Shell
bq show \
--format=prettyjson \
PROJECT_ID:DATASET_NAME.SNAPSHOT_NAME
Replace the following:
PROJECT_ID
: the project ID of the
project that contains the snapshot.
DATASET_NAME
: the name of the dataset
that contains the snapshot.
SNAPSHOT_NAME
: the name of the snapshot.
The output is similar to the following:
{
"creationTime": "1593194331936",
...
"snapshotDefinition": {
"baseTableReference": {
"datasetId": "myDataset",
"projectId": "myProject",
"tableId": "mytable"
},
"snapshotTime": "2020-06-26T17:58:50.815Z"
},
"tableReference": {
"datasetId": "otherDataset",
"projectId": "myProject",
"tableId": "mySnapshot"
},
"type": "SNAPSHOT"
}
API
Call the
tables.get
method with the following parameters:
Parameter |
Value |
projectId |
The project ID of the project that contains the snapshot. |
datasetId |
The name of the dataset that contains the snapshot. |
tableId |
The name of the snapshot. |
The response body is similar to the following:
{
"kind": "bigquery#table",
"etag": "...",
"id": "myProject:myDataset.mySnapshot",
"selfLink": "https://content-bigquery.googleapis.com/bigquery/v2/projects/myProject/datasets/myDataset/tables/mySnapshot",
"tableReference": {
"projectId": "myProject",
"datasetId": "myDataset",
"tableId": "mySnapshot"
},
"description": "...",
"schema": {
"fields": [
...
]
},
"numBytes": "637931",
"numLongTermBytes": "0",
"numRows": "33266",
"creationTime": "1593194331936",
"lastModifiedTime": "1593194331936",
"type": "SNAPSHOT",
"location": "US",
"snapshotDefinition": {
"baseTableReference": {
"projectId": "myProject",
"datasetId": "otherDataset",
"tableId": "myTable"
},
"snapshotTime": "2020-06-26T17:58:50.815Z"
}
}
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis document details how to view metadata for BigQuery table snapshots using the Google Cloud console, SQL queries, the \u003ccode\u003ebq show\u003c/code\u003e command, or the \u003ccode\u003etables.get\u003c/code\u003e API.\u003c/p\u003e\n"],["\u003cp\u003eViewing table snapshot metadata requires the \u003ccode\u003ebigquery.tables.get\u003c/code\u003e permission, which is granted by roles like \u003ccode\u003ebigquery.metadataViewer\u003c/code\u003e, \u003ccode\u003ebigquery.dataViewer\u003c/code\u003e, \u003ccode\u003ebigquery.dataEditor\u003c/code\u003e, \u003ccode\u003ebigquery.dataOwner\u003c/code\u003e, or \u003ccode\u003ebigquery.admin\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTable snapshot metadata is similar to standard table metadata, but includes a \u003ccode\u003ebaseTableReference\u003c/code\u003e to identify the source table and has a \u003ccode\u003etype\u003c/code\u003e field set to \u003ccode\u003eSNAPSHOT\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can query the \u003ccode\u003eINFORMATION_SCHEMA.TABLE_SNAPSHOTS\u003c/code\u003e view to retrieve metadata details about a table snapshot, or use \u003ccode\u003ebq show\u003c/code\u003e in the command line.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etables.get\u003c/code\u003e API method allows you to retrieve the table snapshot metadata, and needs the \u003ccode\u003eprojectId\u003c/code\u003e, \u003ccode\u003edatasetId\u003c/code\u003e, and \u003ccode\u003etableId\u003c/code\u003e to identify the snapshot.\u003c/p\u003e\n"]]],[],null,["# View table snapshot metadata\n============================\n\nThis document describes how to view the metadata for a BigQuery table\nsnapshot in the Google Cloud console, by querying the [`TABLE_SNAPSHOTS`](/bigquery/docs/information-schema-snapshots)\nview of the\n`INFORMATION_SCHEMA` table, by using the [`bq show`](/bigquery/docs/reference/bq-cli-reference#bq_show)\ncommand, or by calling the\n[`tables.get`](/bigquery/docs/reference/rest/v2/tables/get) API.\nIt is intended for users who are familiar with\nBigQuery\n[tables](/bigquery/docs/tables-intro) and\n[table snapshots](/bigquery/docs/table-snapshots-intro).\n\nPermissions and roles\n---------------------\n\nThis section describes the\n[Identity and Access Management (IAM) permission](/bigquery/docs/access-control#bq-permissions)\nthat you need to view the metadata for a table snapshot, and the\n[predefined IAM roles](/bigquery/docs/access-control#bigquery)\nthat grant those permissions.\n\n### Permissions\n\nTo view a table snapshot's metadata, you need the following permission:\n\n### Roles\n\nThe predefined BigQuery roles that provide the required\npermission are as follows:\n\nGet a table snapshot's metadata\n-------------------------------\n\nThe metadata for a table snapshot is similar to the metadata for a standard\ntable, with the following differences:\n\n- An additional `baseTableReference` field identifies the base table that the snapshot was taken from.\n- The `type` field has the value `SNAPSHOT`.\n\nYou can view the metadata for a table snapshot by using one of the\nfollowing options: \n\n### Console\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. In the **Explorer** pane, expand the project and dataset nodes of the\n table snapshot you want to look at.\n\n3. Click the name of the table snapshot.\n\n4. In the snapshot pane that appears, you can do the following:\n\n - Click the **Schema** tab to view the table snapshot's schema and\n policy tags.\n\n - Click the **Details** table to view the table snapshot's size,\n expiration, base table, snapshot time, and other information.\n\n### SQL\n\nTo see metadata for a table snapshot, query the\n[`INFORMATION_SCHEMA.TABLE_SNAPSHOTS` view](/bigquery/docs/information-schema-snapshots):\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. In the query editor, enter the following statement:\n\n ```googlesql\n SELECT\n *\n FROM\n PROJECT_ID.DATASET_NAME.INFORMATION_SCHEMA.TABLE_SNAPSHOTS\n WHERE\n table_name = '\u003cvar translate=\"no\"\u003eSNAPSHOT_NAME\u003c/var\u003e';\n ```\n\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the project that contains the snapshot.\n - \u003cvar translate=\"no\"\u003eDATASET_NAME\u003c/var\u003e: the name of the dataset that contains the snapshot.\n - \u003cvar translate=\"no\"\u003eSNAPSHOT_NAME\u003c/var\u003e: the name of the snapshot.\n\n \u003cbr /\u003e\n\n3. Click play_circle **Run**.\n\n \u003cbr /\u003e\n\nFor more information about how to run queries, see [Run an interactive query](/bigquery/docs/running-queries#queries).\n\n### bq\n\nEnter the following command in the Cloud Shell:\n\n[Go to Cloud Shell](https://console.cloud.google.com/bigquery?cloudshell=true) \n\n```bash\nbq show \\\n--format=prettyjson \\\nPROJECT_ID:DATASET_NAME.SNAPSHOT_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the project that contains the snapshot.\n- \u003cvar translate=\"no\"\u003eDATASET_NAME\u003c/var\u003e: the name of the dataset that contains the snapshot.\n- \u003cvar translate=\"no\"\u003eSNAPSHOT_NAME\u003c/var\u003e: the name of the snapshot.\n\n\u003cbr /\u003e\n\nThe output is similar to the following: \n\n```json\n{\n \"creationTime\": \"1593194331936\",\n ...\n \"snapshotDefinition\": {\n \"baseTableReference\": {\n \"datasetId\": \"myDataset\",\n \"projectId\": \"myProject\",\n \"tableId\": \"mytable\"\n },\n \"snapshotTime\": \"2020-06-26T17:58:50.815Z\"\n },\n \"tableReference\": {\n \"datasetId\": \"otherDataset\",\n \"projectId\": \"myProject\",\n \"tableId\": \"mySnapshot\"\n },\n \"type\": \"SNAPSHOT\"\n}\n```\n\n### API\n\nCall the\n[`tables.get`](/bigquery/docs/reference/rest/v2/tables/get)\nmethod with the following parameters:\n\nThe response body is similar to the following: \n\n```json\n{\n \"kind\": \"bigquery#table\",\n \"etag\": \"...\",\n \"id\": \"myProject:myDataset.mySnapshot\",\n \"selfLink\": \"https://content-bigquery.googleapis.com/bigquery/v2/projects/myProject/datasets/myDataset/tables/mySnapshot\",\n \"tableReference\": {\n \"projectId\": \"myProject\",\n \"datasetId\": \"myDataset\",\n \"tableId\": \"mySnapshot\"\n },\n \"description\": \"...\",\n \"schema\": {\n \"fields\": [\n ...\n ]\n },\n \"numBytes\": \"637931\",\n \"numLongTermBytes\": \"0\",\n \"numRows\": \"33266\",\n \"creationTime\": \"1593194331936\",\n \"lastModifiedTime\": \"1593194331936\",\n \"type\": \"SNAPSHOT\",\n \"location\": \"US\",\n \"snapshotDefinition\": {\n \"baseTableReference\": {\n \"projectId\": \"myProject\",\n \"datasetId\": \"otherDataset\",\n \"tableId\": \"myTable\"\n },\n \"snapshotTime\": \"2020-06-26T17:58:50.815Z\"\n }\n}\n```\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- [Update a table snapshot's description, expiration date, or\n access policy](/bigquery/docs/table-snapshots-update).\n- [Delete a table snapshot](/bigquery/docs/table-snapshots-delete)."]]