BigQuery select * except nested column
The way to think of the problem is that you still want a payload
column in the result, but you want it to have a different structure, namely to exclude comment
. In this case, you can use SELECT * REPLACE
to make the modification. For example,
#standardSQL
SELECT * REPLACE ((SELECT AS STRUCT payload.* EXCEPT (comment)) AS payload)
FROM `bigquery-public-data.samples.github_nested`
LIMIT 1000;