Repository navigation
Warehouse BigQuery
The
bigqueryreader crawls a project's datasets from region-level and dataset-levelINFORMATION_SCHEMAviews (catalog = project, schema = dataset). Metadata queries are billed (at least 10 MiB each), so the reader batches per dataset and reports the bytes billed to the crawl and its budget. Built from documented view shapes and tested against recorded fixtures; not yet validated against a live project (opt-in live test below).
Reader: bigquery (schemaguru.catalog.readers.bigquery.BigQueryReader). Catalog = project, schema = dataset. Extra: pip install "schemaguru[bigquery]" (google-cloud-bigquery).
Region views `region-<r>`.INFORMATION_SCHEMA.SCHEMATA and TABLE_STORAGE (row count, logical bytes, last modified), and dataset views TABLES, TABLE_OPTIONS (description), COLUMNS, COLUMN_FIELD_PATHS (column descriptions), TABLE_CONSTRAINTS, KEY_COLUMN_USAGE, CONSTRAINT_COLUMN_USAGE.
-
bigquery.jobs.createon the billing project (roleBigQuery Job User). -
bigquery.tables.get/bigquery.tables.list/bigquery.datasets.geton the datasets to read (roleBigQuery Metadata Viewer).TABLE_STORAGEadditionally needsbigquery.tables.geton the project.
INFORMATION_SCHEMA queries are billed on-demand, minimum 10 MiB each. The reader batches columns and constraints per dataset (one query per dataset per call) and exposes bytes_billed, which the crawl copies into CrawlReport.bytes_billed and the budget ledger. If the executor offers last_bytes_billed (the job's total_bytes_billed) the reader sums it; otherwise it counts the 10 MiB minimum per query and sets bytes_billed_is_lower_bound. Use budget.crawl_bytes to cap a crawl: it is checked before each listing query, and at the cap the crawl stops between pages with SG110 and resumes from its checkpoint next time.
-
regionmust match the datasets' location (us,eu,europe-west3, ...); a region view only lists datasets in it. Passproject=andregion=to the reader. - Project, dataset and region are interpolated (they cannot be bound) and are validated against a strict character set; every value is bound with
?. -
column_defaultis the textNULLwhen there is none; the reader maps it to unknown. - Key constraints are declared, not enforced (
enforced=False). A foreign key whose referenced columns cannot be resolved inside the dataset is omitted rather than guessed. - Partitioning and clustering are not read (they would need
COLUMNS.is_partitioning_column/clustering_ordinal_positionper table); both stay unknown. - Live test:
SCHEMAGURU_LIVE_BIGQUERY=1 SCHEMAGURU_BQ_PROJECT=... SCHEMAGURU_BQ_REGION=... SCHEMAGURU_BQ_DATASET=...(ADC credentials). -
Incremental crawls miss schema-only changes. The incremental listing uses
TABLE_STORAGE.storage_last_modified_time, which anALTER TABLE ... ADD COLUMNmay not move. Run a periodic full crawl:sg.catalog.crawl(guru.reader, guru.store, config=guru.config.crawl, incremental=False). - Measurement is billed by columns read; key-hash sampling does not reduce bytes for the key columns, so a huge table's value discovery may be over the per-probe budget (
SG301). See Sampling.
SchemaGuru is open source under the MIT License, Copyright (c) 2026 Rupak Chakraborty · Repository · Issues · This wiki is generated from docs/wiki/; edit it there, not here.
Start here
Components
- Catalog and Crawl
- Store
- Measurement
- Sampling
- Join Graph
- Path Search and Hub Guard
- Waypoint Rules
- Drafting
- PII and Sampling Policy
- Overlays
- Scoping
- Rendering
- Refresh and Drift
- Feedback and Guard
- Server
- Agent Integration
Using it
Warehouses
- BigQuery
- Snowflake
- Redshift
- Databricks
- PostgreSQL
- DuckDB
- ClickHouse
- SQL Server / Synapse
- Oracle
- Trino
- MySQL / MariaDB
Extending
- CatalogReader
- Store
- Retriever and Embedder
- TokenCounter
- LLMProvider
- PII Detector
- FailureClassifier
- FactKind
- Profile and Format
- ChangeClassifier
- JoinCandidateSource (planned)
- Authenticator
Project