Предполагая, что это запрос для построения начальных данных
SELECT
'myname@gmail.com' AS customer_email,
CAST('2018-12-25 04:00:02 UTC' AS TIMESTAMP) AS submitted_at,
CAST('2018-12-25 03:59:07 UTC' AS TIMESTAMP) AS landed_at,
'How would you rate this product?' as title,
STRUCT (
[
STRUCT('' as label)
] AS choices,
10 as number,
NULL as boolean
) answers,
STRUCT (
'other' AS platform
) metadata
UNION ALL
SELECT
'myname@gmail.com' AS customer_email,
CAST('2018-12-25 04:00:02 UTC' AS TIMESTAMP) AS submitted_at,
CAST('2018-12-25 03:59:07 UTC' AS TIMESTAMP) AS landed_at,
'What did you enjoy the most about your experience with us?' as title,
STRUCT (
[
STRUCT('' as label)
] AS choices,
NULL as number,
NULL as boolean
) answers,
STRUCT (
'other' AS platform
) metadata
UNION ALL
SELECT
'myname@gmail.com' AS customer_email,
CAST('2018-12-25 04:00:02 UTC' AS TIMESTAMP) AS submitted_at,
CAST('2018-12-25 03:59:07 UTC' AS TIMESTAMP) AS landed_at,
'What other product(s) would you like to see us make?' as title,
STRUCT (
[
STRUCT('Additional Designs' as label),
STRUCT('Additional Colors' as label)
] AS choices,
NULL as number,
NULL as boolean
) answers,
STRUCT (
'other' AS platform
) metadata
UNION ALL
SELECT
'myname@gmail.com' AS customer_email,
CAST('2018-12-25 04:00:02 UTC' AS TIMESTAMP) AS submitted_at,
CAST('2018-12-25 03:59:07 UTC' AS TIMESTAMP) AS landed_at,
'What color(s) would you want to see?' as title,
STRUCT (
[
STRUCT('Green' as label)
] AS choices,
NULL as number,
NULL as boolean
) answers,
STRUCT (
'other' AS platform
) metadata
Тогда ваш запрос будет
WITH joined_table AS (
SELECT
customer_email,
submitted_at,
landed_at,
title,
answers.choices answers_choices,
answers.number score,
answers.boolean true_false,
metadata.platform device_type
FROM `sample.responses` resp
LEFT JOIN `sample.forms` forms ON resp.answers.field.id = forms.id
)
SELECT
customer_email,
submitted_at,
landed_at,
title,
unnested_answers_choices.label as answer_choices,
score,
true_false,
device_type
FROM joined_table
CROSS JOIN UNNEST(answers_choices) AS unnested_answers_choices