bigquery

Generates optimized BigQuery SQL, BigFrames code, and BQML AI function queries.

9|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/jerrylin96/dotgemini --skill bigquery-jerrylin96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bigquery
Source: https://github.com/jerrylin96/dotgemini/tree/main/skills/bigquery
Command: npx skills add https://github.com/jerrylin96/dotgemini --skill bigquery-jerrylin96

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct and performant BigQuery SQL, BigFrames DataFrame code, and BQML AI functions requires deep knowledge of syntax rules, optimization patterns, and function-specific constraints that are easy to get wrong. ## Core Features & Use Cases - SQL Query Optimization: Applies column pruning, predicate pushdown, early aggregation, and mandatory rewrites like replacing IN subqueries with EXISTS. - BigFrames Code Generation: Enforces best practices for BigQuery DataFrames, including avoiding to_pandas(), using bigframes.ml for machine learning, and staying in the cloud. - BQML & AI Functions: Provides exact syntax and argument references for AI.FORECAST, AI.EVALUATE, AI.GENERATE_TABLE, AI.GENERATE_EMBEDDING, VECTOR_SEARCH, and contribution analysis models. - Use Case: Ask for a time-series forecast of sales data and receive a valid AI.FORECAST query using TimesFM with correct named arguments, horizon limits, and output schema handling. ## Quick Start Write an optimized BigQuery SQL query that forecasts monthly revenue by region using AI.FORECAST.

Frequently Asked Questions about 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. Mandatory rewrites include replacing WHERE col IN (SELECT ...) with WHERE EXISTS, and choosing VIEW versus TABLE materialization based on freshness, cost, and reuse.

How do I use AI.FORECAST in BigQuery for time-series prediction?

Call AI.FORECAST as a table-valued function in the FROM clause with data_col and timestamp_col as required arguments. It uses the TimesFM model, supports id_cols for multiple series, horizon from 1 to 10000, and optional confidence_level and context_window settings.

What is the difference between BigFrames and pandas for BigQuery data?

BigFrames executes operations in BigQuery rather than local memory, so you should avoid to_pandas() and read_gbq() for SQL. Use bigframes.ml instead of scikit-learn, and prefer built-in accessors over UDFs or lambdas.

Does AI.GENERATE_TABLE require a specific input format?

Yes, the input table or subquery must contain a column named or aliased as prompt, and the output_schema argument must be a quoted string of SQL column definitions. The function must be placed in the FROM clause as a table-valued function.

Why does my BigQuery remote model creation fail?

Remote models require a connection to Vertex AI, created with REMOTE WITH CONNECTION DEFAULT or a fully qualified connection ID. Verify the endpoint name is valid, such as gemini-2.5-flash or text-embedding-005, and that the dataset exists via CREATE SCHEMA IF NOT EXISTS.

When should I use APPROX_COUNT_DISTINCT instead of COUNT DISTINCT in BigQuery?

Use APPROX_COUNT_DISTINCT when approximate results are acceptable, since it is faster and uses less memory. This change is conditional and should be proposed with user confirmation because it trades exactness for performance.