Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BQ STRUCT versus RECORD types?

May be a very trivial question. What is the actual difference between STRUCT and RECORD types in GCP BigQuery? Can I use them interchangably? If I have a table created with a column defined as STRUCT, will it show a "schema" mismatch if I try to re-run a Terraform script with the field type changed to RECORD?

like image 546
Vinod Avatar asked Jul 31 '26 05:07

Vinod


1 Answers

I believe they are mostly the same thing, or you may view them as same concept in different components of BigQuery.

For historical reasons the Legacy SQL and storage documentation talks mostly about RECORD, while Standard SQL dialect uses STRUCT.

A column created with Standard SQL DDL as STRUCT will appear as RECORD in storage UI, and Terraform script using RECORD should be compatible.

like image 76
Michael Entin Avatar answered Aug 02 '26 18:08

Michael Entin