| name | description |
|---|---|
bigquery-schema |
Fetch and inspect BigQuery table schemas using the bq CLI (part of the Google Cloud SDK). Use when you need to look up column names, types, or structure of a BigQuery table before writing SQL queries or building pipeline assets. |
Use the bq CLI (bundled with gcloud SDK) to inspect table schemas before writing queries or pipeline code.
bq show --schema --format=prettyjson --project_id=PROJECT DATASET.TABLEReturns a JSON array of field objects with name, type, mode, and optional description/fields (for RECORD types).
Example:
# Show schema for `example_project.example_dataset.example_table`
bq show --schema --format=prettyjson --project_id=example_project \
example_dataset.example_tablebq show --project_id=PROJECT DATASET.TABLEbq ls --project_id=PROJECT DATASET- Run
gcloud auth loginorgcloud auth application-default loginfirst if not authenticated. - Omit
PROJECT:to use the default project configured ingcloud config. - For RECORD (STRUCT) columns, nested fields appear under
"fields"in the JSON output. - Use
--format=jsoninstead ofprettyjsonwhen piping output to scripts.