developing-with-bigquery

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

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/Jatinkrmahato993203/crime --skill developing-with-bigquery-jatinkrmahato993203
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-with-bigquery
Source: https://github.com/Jatinkrmahato993203/crime/tree/main/skills/developing-with-bigquery
Command: npx skills add https://github.com/Jatinkrmahato993203/crime --skill developing-with-bigquery-jatinkrmahato993203

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 code follows Google's standards and avoids 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 DataFrame code, avoiding anti-patterns like unnecessary to_pandas() calls, read_gbq() for SQL, and scikit-learn mixing. - 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 with named arguments, proper FROM-clause placement, and the right output schema. ## Quick Start Use the BigQuery skill to write an optimized SQL query that forecasts next month's sales by region using AI.FORECAST.

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 choose TABLE over VIEW for large or reused intermediate results. Conditionally consider UNION ALL and APPROX_COUNT_DISTINCT for further gains.

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

Call AI.FORECAST as a table-valued function in the FROM clause with your input table, data_col, and timestamp_col as required arguments. Use named arguments with the => operator for optional parameters like horizon, id_cols, and confidence_level. It uses TimesFM models without requiring training.

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

BigFrames should be the default choice because it is more efficient than the BigQuery Python client library. Avoid read_gbq() for SQL execution and use BigFrames DataFrame methods instead, keeping computation in the cloud rather than downloading data with to_pandas().

Can I use scikit-learn with BigFrames DataFrames?▼

No, you should import ML tools from bigframes.ml instead of scikit-learn. BigFrames ML handles scaling automatically, its predict() returns a DataFrame with predictions and features, and models do not accept a random_state argument.

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

AI.GENERATE_TABLE requires the input subquery to contain a column aliased as prompt, and the output_schema string must be enclosed in quotes. The function must also be placed in the FROM clause as a table-valued function with a remote Gemini model.

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

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 is the recommended behavior; otherwise specify a fully qualified connection ID.