スキル一覧に戻る
sourcegraph

bigquery

by sourcegraph

This is a repository for custom slash commands and tools that are not part of the core Amp agentic coding tool

13🍴 0📅 2026年1月8日
GitHubで見るManusで実行

SKILL.md


name: bigquery description: Instructions for querying Google BigQuery using the bq command-line tool. Useful for running SQL queries, exploring datasets, and exporting results.

BigQuery Skill

This skill enables you to query Google BigQuery using the bq command-line tool.

Authentication is already configured. The default project is project_id.

Use the project_id_exploration dataset as scratch space for temporary tables and experimentation.

The public dataset contains tables synced from the production Postgres database.

1. Explore Available Datasets

List datasets in the current project (defaults to project_id):

bq ls

List datasets in a specific project:

bq ls --project_id=PROJECT_ID

List tables in a dataset:

bq ls PROJECT_ID:DATASET_NAME

Get table schema:

bq show --schema --format=prettyjson PROJECT_ID:DATASET_NAME.TABLE_NAME

2. Run Queries

Run a simple query:

bq query --use_legacy_sql=false 'SELECT * FROM `project.dataset.table` LIMIT 10'

Run a query with formatted output:

bq query --use_legacy_sql=false --format=prettyjson 'YOUR_QUERY'

Run a query and save to a destination table:

bq query --use_legacy_sql=false --destination_table=PROJECT:DATASET.NEW_TABLE 'YOUR_QUERY'

Run a dry run to estimate costs:

bq query --use_legacy_sql=false --dry_run 'YOUR_QUERY'

3. Export Results

Export to CSV:

bq query --use_legacy_sql=false --format=csv 'YOUR_QUERY' > results.csv

4. Best Practices

  • Always use --use_legacy_sql=false for standard SQL syntax
  • Use LIMIT clauses when exploring data to reduce costs
  • Use --dry_run to estimate query costs before running expensive queries
  • Use backticks around table references: `project.dataset.table`

5. Common Patterns

Preview table data:

bq head -n 10 PROJECT:DATASET.TABLE

Get table info (row count, size):

bq show --format=prettyjson PROJECT:DATASET.TABLE

Query with parameters:

bq query --use_legacy_sql=false --parameter='name:STRING:value' 'SELECT * FROM `table` WHERE col = @name'

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です