bigquery-bigtable-compact-reverse-etl

Export BigQuery data to Cloud Bigtable using Avro binary serialization and Deflate compression UDFs.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill bigquery-bigtable-compact-reverse-etl-ricardolui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bigquery-bigtable-compact-reverse-etl
Source: https://github.com/ricardolui/gcp-custom-agent-skills/tree/main/bigquery-bigtable-compact-reverse-etl
Command: npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill bigquery-bigtable-compact-reverse-etl-ricardolui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fastavro, google-cloud-bigtable.

What problem does it solve? Exporting data from BigQuery to Cloud Bigtable with plain JSON wastes up to 40-50% of SSD storage due to repeated field names and uncompressed payloads, driving up serving costs and latency. ## Core Features & Use Cases - Persistent UDF Library: Provides ready-to-deploy BigQuery JavaScript UDFs that serialize rows into schemaless Avro binary (ZigZag varints, length-prefixed strings) and optionally apply inline Deflate compression. - EXPORT DATA Recipes: Supplies complete EXPORT DATA queries using format='CLOUD_BIGTABLE' with rowkey mapping, single-cell payloads, and auto-created column families. - Client Deserialization Pattern: Includes Python code using fastavro and zlib to decompress and decode cells with sub-millisecond reads. - Use Case: A data engineering team exporting millions of user profile rows nightly to Bigtable can cut SSD storage costs by roughly 40% by switching from JSON cells to the Avro + Deflate single-cell pattern. ## Quick Start Ask the assistant to generate a BigQuery EXPORT DATA query that writes a table to Cloud Bigtable using the compressed Avro UDF pattern.

Frequently Asked Questions about bigquery-bigtable-compact-reverse-etl

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

FAQPage Schema
How do I export data from BigQuery to Cloud Bigtable?

Use the EXPORT DATA statement with format='CLOUD_BIGTABLE', a URI pointing to your Bigtable table and app profile, and a SELECT that produces a rowkey column plus payload columns. Enable auto_create_column_families or pre-create the column families before running the export.

How to reduce Cloud Bigtable storage costs for BigQuery exports?

Serialize rows into a single cell using schemaless Avro binary encoding instead of JSON, which removes repeated field names, then apply Deflate compression. This combination reduces Bigtable SSD storage by roughly 39-50% compared to plain JSON cells.

What BigQuery edition is required for Bigtable reverse ETL exports?

The project must be attached to a BigQuery reservation with Enterprise or Enterprise Plus edition (or dedicated slots) in the same region as the data. The Bigtable cluster must also reside in the same region or within the dataset's multi-region.

Avro binary vs Avro with Deflate compression for Bigtable exports?

Plain Avro binary saves 10-15% storage at about 5,000 rows per second export throughput, while Avro plus Deflate saves 39-50% but drops throughput to about 2,400 rows per second and doubles slot compute per row. Choose compressed Avro for best cost-benefit on storage-heavy workloads.

How do I deserialize Avro-compressed Bigtable cells in Python?

Read the cell value, decompress it with zlib.decompress using the -15 raw deflate window, then decode the bytes with fastavro.schemaless_reader against your parsed Avro schema. This yields the original record fields with sub-millisecond latency.

Why should BigQuery UDFs for serialization be persistent instead of temporary?

Persistent UDFs stored in a shared utilities dataset are created once and reused by every export query and pipeline, avoiding repeated UDF definitions in each job. This keeps export queries shorter and standardizes the serialization logic across teams.