BigQuery now supports identity columns, a built‑in way to generate sequential 64‑bit integers for a table column. This change removes the need for external services or custom logic to produce unique keys, which directly impacts data‑pipeline design for AI, cloud, DevOps, and security engineers.
What changed: identity columns in BigQuery
Two clause forms can be added to a CREATE TABLE statement:
- GENERATED ALWAYS AS IDENTITY – BigQuery fully controls the value and guarantees uniqueness.
- GENERATED BY DEFAULT AS IDENTITY – BigQuery supplies a value but allows an explicit override.
Both clauses produce a sequential 64‑bit integer that starts at a configurable point and increments by a configurable step. The feature is scoped to the table definition; no separate service or external sequence object is required.
Why it matters for pipeline engineers
Automatic key generation simplifies three common pipeline concerns:
- Ingestion without pre‑calculated keys – Load jobs, streaming inserts, or batch
INSERTstatements no longer need a prior step to compute a unique identifier. - Reduced boilerplate – SQL that previously concatenated UUID functions or joined to a lookup table can be trimmed to the business columns only.
- Consistent DML behavior –
INSERTandMERGEstatements automatically receive a new identifier, preserving idempotency when the same source row is re‑processed.
Implementation considerations
When adding an identity column, the definition must be part of the CREATE TABLE DDL. A minimal example looks like this:
CREATE TABLE my_project.my_dataset.orders (
order_id INT64 GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1),
customer_name STRING,
order_date DATE
);
INSERT INTO my_project.my_dataset.orders (customer_name, order_date)
VALUES ('Joe Doe', CURRENT_DATE());
Key points to verify during rollout:
- Choose
ALWAYSwhen the column must never be supplied by the client; chooseBY DEFAULTif occasional manual overrides are required. - The clause syntax is part of the table schema; altering an existing column to become an identity column requires a table recreation or schema migration.
- Identity columns work with standard DML but are not a replacement for primary‑key constraints; they simply guarantee a unique numeric value.
Operational and security notes
From an operations perspective, the sequence is managed internally by BigQuery, so there is no external state to back up or replicate. Monitoring should focus on table write patterns to ensure the generated values remain within expected ranges.
Security‑wise, the ability to insert rows (and thus generate identifiers) is still governed by BigQuery IAM permissions. Teams should verify that only authorized service accounts have bigquery.tables.updateData or bigquery.tables.insertData on tables that expose an identity column, preventing unauthorized row creation.
Related CloudNinjas coverage: Google Cloud.
What This Means For Practitioners
Adopt identity columns on new tables where a simple numeric key is sufficient. For existing pipelines, evaluate whether the current key‑generation step can be removed or replaced with the GENERATED BY DEFAULT AS IDENTITY clause to retain flexibility. Update IAM policies to limit write access to the tables that now auto‑generate identifiers, and add basic health checks that confirm the column continues to produce sequential values as expected.


