bq-query
2
总安装量
2
周安装量
#67290
全站排名
安装命令
npx skills add https://github.com/yusuke-suzuki/dotfiles --skill bq-query
Agent 安装分布
amp
2
gemini-cli
2
github-copilot
2
codex
2
kimi-cli
2
cursor
2
Skill 文档
BigQuery Query
Rules: Follow coding-standards for SQL naming and readability.
Prerequisites
Check gcloud configuration before running queries:
gcloud config get-value project
- If authentication error: prompt user to run
gcloud auth login, then resume - If project unset: prompt user to run
gcloud config set project <PROJECT_ID>
Workflow
-
Clarify requirements: Understand what data is needed and why. If requirements are already in context, proceed to next step.
-
Understand schema: Explore available datasets. If schema is already in context, proceed to next step.
bq ls project:dataset # List tables bq show --schema project:dataset.table # Show table schema -
Design query: Write SQL based on requirements and schema.
- Use CTEs for readability
- Use fully-qualified table names:
project.dataset.table - Specify exact date ranges to limit scanned data
- Filter partitioned tables by partition key
- Avoid correlated subqueries (use JOINs/CTEs)
- Filter early with CTEs before joining large tables
- Use
LIMITfor exploration queries
-
Dry run: Validate syntax and estimate cost
bq query --use_legacy_sql=false --dry_run "SELECT ..."Cost: ~$5/TB. If >2GB, ask user before executing.
-
Execute: Run after successful dry run, once any required user confirmation has been given
bq query --use_legacy_sql=false --format=csv "SELECT ..."