get_table_schema
Inspect a BigQuery table's columns, partitioning, size, and freshness before querying. Reveals partition filters and nested fields needing UNNEST—without scanning data.
Instructions
Get a table's columns, partitioning, size and freshness. Free — scans no data.
Call this before writing a query, for two reasons beyond column names:
partitioningsays whether a WHERE clause can actually limit the scan. A date-shaped column name does NOT mean the table is partitioned; if this field is null, every query reads the whole table.Nested columns are expanded to dotted paths and flagged
repeated, which is what tells you a column needs UNNEST.
Args: dataset_id: The dataset, e.g. "events_raw". table_id: The table or view name. environment: Which configured BigQuery environment to use. Omit to use the default. Call list_environments to see what exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_id | Yes | ||
| dataset_id | Yes | ||
| environment | No |