Google BigQuery (50 Qs)•Part 3: Enterprise FinOps, Disaster Recovery & Scale (25 - 35)
Cost Control Best Practices in BigQuery: Dry-run, maximum bytes billed, and partition filter enforcement.
senior LevelCode ExamplebigqueryEnterprise FinOps
In Simple Words: Preventing developer queries from running multi-thousand-dollar scans:
- Dry-Run Validation: Call the API with
dryRun=trueor inspect the query validator in the console to verify exact byte scan volume before running. - Maximum Bytes Billed: Set
maximum_bytes_billed = 107374182400(100 GB). If a query's scan estimate exceeds 100 GB, it aborts instantly without incurring billing. - Enforce Partition Filters:
Any query without asql
ALTER TABLE `analytics.events` SET OPTIONS (require_partition_filter = true);WHERE _PARTITIONDATE = ...is automatically rejected by the compiler.