developing-with-bigquery

Generates optimized BigQuery SQL, BigFrames Python code, and BigQuery ML function syntax.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/DingJun1028/esggo-kv --skill developing-with-bigquery-dingjun1028
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-with-bigquery
Source: https://github.com/DingJun1028/esggo-kv/tree/main/.agents/skills/developing-with-bigquery
Command: npx skills add https://github.com/DingJun1028/esggo-kv --skill developing-with-bigquery-dingjun1028

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct and performant BigQuery code requires deep knowledge of SQL optimization rules, BigFrames library conventions, and the exact syntax of BigQuery ML/AI functions. This Skill provides routing to specialized reference guides so generated queries, DataFrame code, and ML function calls follow validated standards and avoid common mistakes. ## Core Features & Use Cases - Query Optimization: Applies column pruning, predicate pushdown, early aggregation, and mandatory rewrites like replacing IN subqueries with EXISTS. - BigFrames Code Generation: Produces valid BigFrames Python code that avoids to_pandas() pitfalls, uses bigframes.ml for modeling, and keeps computation in the cloud. - BigQuery ML & AI Functions: Supplies exact syntax for AI.FORECAST, AI.EVALUATE, AI.GENERATE_TABLE, AI.GENERATE_EMBEDDING, VECTOR_SEARCH, contribution analysis, and remote model creation. - Use Case: Ask for a time-series forecast of daily sales by store, and receive a correct AI.FORECAST query using TimesFM with proper named arguments, id_cols grouping, and confidence intervals. ## Quick Start Ask the assistant to write an optimized BigQuery query or a BigFrames script for your dataset, for example to forecast sales or generate text embeddings.

Frequently Asked Questions about developing-with-bigquery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize a slow BigQuery SQL query?▼

Apply column pruning, predicate pushdown, early aggregation before joins, and common subexpression reuse. Rewrite IN subqueries as EXISTS, and consider UNION ALL or APPROX_COUNT_DISTINCT when approximate results are acceptable.

How do I forecast time series data in BigQuery without training a model?▼

Use the AI.FORECAST table-valued function with your data column, timestamp column, and optional id_cols for grouping. It uses TimesFM endpoints, auto-detects frequency, and defaults to a 30-point horizon with 0.95 confidence.

Should I use BigFrames or the BigQuery Python client library?▼

BigFrames should be the default choice because it keeps computation in BigQuery rather than moving data locally. Avoid read_gbq() for SQL and to_pandas() for full datasets; use DataFrame methods and bigframes.ml for modeling.

How do I create a remote model in BigQuery for Gemini?▼

Use CREATE MODEL with REMOTE WITH CONNECTION DEFAULT and set the ENDPOINT option to a model like gemini-2.5-flash or text-embedding-005. The default connection in the model's region is the recommended approach.

Why does AI.GENERATE_TABLE fail on my input query?▼

The input subquery must contain a column aliased as prompt, and the output_schema string must be enclosed in quotes. AI.GENERATE_TABLE is a table-valued function, so it must be called in the FROM clause.

When should I not use to_pandas() with BigFrames?▼

Avoid to_pandas() for downloading entire datasets into memory. It is acceptable only when an error explicitly requires it or when a visualization library cannot accept BigFrames objects, and only after reducing the data size first.