Assume we have a BigQuery table like the following:
Where "Col1" is a Record field. What would be the most efficient way to "flatten out" the table so that part of the Record field becomes columns:
Assume we have a BigQuery table like the following:
Where "Col1" is a Record field. What would be the most efficient way to "flatten out" the table so that part of the Record field becomes columns:
Consider below option
select * from (
select key, name, value
from your_table, unnest(col1)
)
pivot (any_value(value) for name in ('A','B','C','D'))
if applied to sample data as in your question
the output is