Stay organized with collections Save and categorize content based on your preferences.
System procedures referenceBigQuery supports the following system procedures, which can be used similarly to user-created stored procedures.
BQ.ABORT_SESSIONSyntax
CALL BQ.ABORT_SESSION([session_id]);
Description
Terminates your current session.
You can optionally specify the session ID, which lets you terminate a session if the system procedure isn't called from that session.
For more information, see Terminating sessions.
BQ.JOBS.CANCELSyntax
CALL BQ.JOBS.CANCEL(job);
Description
Cancels a running job.
Specify the job as a string with the format '[project_id.]job_id'
. If you run this system procedure from a different project than the job, then you must include the project ID. You must run the procedure in the same location as the job.
For more information, see Canceling a job.
Syntax
CALL BQ.REFRESH_EXTERNAL_METADATA_CACHE(table_name [, [subdirectory_uri, …]]);
Description
Refreshes the metadata cache of a BigLake table or an object table. This procedure fails if you run it against a table that has the metadata caching mode set to AUTOMATIC
.
To run this system procedure, you need the bigquery.tables.update
and bigquery.tables.updateData
permissions.
Specify the name of the table as a string with the format '[project_id.]dataset.table'
. If you run this system procedure from a different project than the table, then you must include the project ID.
For BigLake tables, you can optionally specify one or more subdirectories of the table data directory in Cloud Storage in the format 'gs://table_data_directory/subdirectory/.../'
. This lets you refresh only the table metadata from those subdirectories and thereby avoid unnecessary metadata processing.
Examples
To refresh all of the metadata for a table:
CALL BQ.REFRESH_EXTERNAL_METADATA_CACHE('myproject.test_db.test_table')
To selectively refresh the metadata for a BigLake table:
CALL BQ.REFRESH_EXTERNAL_METADATA_CACHE('myproject.test_db.test_table', ['gs://source/uri/sub/path/d1/*', 'gs://source/uri/sub/path/d2/*'])
Limitation
Syntax
CALL BQ.REFRESH_MATERIALIZED_VIEW(view_name);
Description
Refreshes a materialized view.
Specify the name of the materialized view as a string with the format '[project_id.]dataset.table'
. If you run this system procedure from a different project than the materialized view, then you must include the project ID.
For more information, see Manual refresh.
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-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-13 UTC."],[[["BigQuery system procedures are similar to user-created stored procedures and offer built-in functionality."],["`BQ.ABORT_SESSION` terminates the current session or a specified session by ID."],["`BQ.JOBS.CANCEL` cancels a running job, requiring the job ID and project ID if executed from a different project."],["`BQ.REFRESH_EXTERNAL_METADATA_CACHE` refreshes the metadata cache of a BigLake or object table, with an option to specify subdirectories for partial refreshes, but cannot be used with automatic caching mode."],["`BQ.REFRESH_MATERIALIZED_VIEW` refreshes a materialized view, and requires the view name, including the project ID if it's in a different project."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4