bigquery-analytics

BigQuery Best Practices

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "bigquery-analytics" with this command: npx skills add trantuananh-17/product-reviews/trantuananh-17-product-reviews-bigquery-analytics

BigQuery Best Practices

Table Design

Partitioning (REQUIRED for tables > 1GB)

CREATE TABLE project.dataset.events ( event_id STRING, shop_id STRING, event_type STRING, created_at TIMESTAMP, data JSON ) PARTITION BY DATE(created_at) CLUSTER BY shop_id, event_type;

Data Size Partition By

< 1GB Not needed

1GB - 1TB DATE/TIMESTAMP

1TB DATE + consider sharding

Query Patterns

Always Use Partition Filter

-- ❌ BAD: No partition filter (full scan) SELECT * FROM events WHERE shop_id = 'shop_123';

-- ✅ GOOD: Partition filter included SELECT * FROM events WHERE created_at >= '2024-01-01' AND created_at < '2024-02-01' AND shop_id = 'shop_123';

Select Only Needed Columns

-- ❌ BAD: SELECT * SELECT * FROM events;

-- ✅ GOOD: Select specific columns SELECT event_id, event_type, created_at FROM events;

Node.js Integration

Always Batch Inserts

// ✅ GOOD: Single batch insert await table.insert(batch.map(row => ({ ...row, time: new Date() })));

// ❌ BAD: Insert one row at a time for (const row of batch) { await table.insert([row]); }

Scenario Max Batch Size

Streaming inserts 500-1000 rows

High throughput Up to 10,000 rows

Cost Control

// Dry run before expensive queries const [job] = await bigquery.createQueryJob({ query: sql, dryRun: true }); const estimatedCost = (job.statistics.totalBytesProcessed / 1e12) * 5;

Checklist

□ Large tables (>1GB) have partitioning □ Queries include partition column in WHERE □ Tables clustered by frequently filtered columns □ No SELECT * - select specific columns □ Using parameterized queries □ Batch inserts (not row-by-row)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

shopify-api-integration

No summary provided by upstream source.

Repository SourceNeeds Review
General

image-gen

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Archived SourceRecently Updated
General

explainer

Create explainer videos with narration and AI-generated visuals. Triggers on: "解说视频", "explainer video", "explain this as a video", "tutorial video", "introduce X (video)", "解释一下XX(视频形式)".

Archived SourceRecently Updated
General

asr

Transcribe audio files to text using local speech recognition. Triggers on: "转录", "transcribe", "语音转文字", "ASR", "识别音频", "把这段音频转成文字".

Archived SourceRecently Updated