This page describes the BigQuery data types and mappings that you must create on your AlloyDB for PostgreSQL cluster when you're accessing BigQuery data from AlloyDB. For more information, see Access BigQuery data from AlloyDB.
Using unsupported mappings can lead to query execution errors or unintended results. For example, mapping a BigQuery string column to a AlloyDB integer column causes an error. However, if you map a string in AlloyDB to a BigQuery integer, the query doesn't error out; instead, the integer is typecasted to a string.
BigQuery table data type |
Recommended PostgreSQL foreign table data types |
|---|---|
BOOLEAN |
BOOLEAN |
INTEGER (INT64) |
BIGINT |
FLOAT (FLOAT64) |
DOUBLE PRECISION |
STRING |
VARCHAR |
NUMERIC |
NUMERIC |
NUMERIC(P[, S]) |
NUMERIC |
BIGNUMERIC |
NUMERIC |
BIGNUMERIC(P[, S]) |
NUMERIC |
DATE |
DATE |
TIMESTAMP |
TIMESTAMPTZ |
TIME |
TIME |
JSON |
JSONB |
BYTES |
BYTEA |
GEOGRAPHY |
GEOGRAPHY(POINT), ...For more information, see PostGIS_Geography. |
DATETIME |
TIMESTAMP |
ARRAY<FLOAT64> |
VECTOR(N)N is the dimension of the vector. Requires setting the flag bigquery_fdw.enable_vector_downcasting in the session.
Since VECTOR type in AlloyDB for PostgreSQL uses float4 type, there is a possibility of precision loss in this conversion.For more information, see pgvector extension. |
What's next
- Access BigQuery data from AlloyDB.
- Sync BigQuery and Iceberg data to AlloyDB.
- Learn about use cases for accessing BigQuery data from AlloyDB.