Nested fields in BigQuery are selected using the dot operator.
I have change-data-captured tables with schemas that have a lot of nested fields. I would like to do something like this:
SELECT
after.name as name,
after.age as age,
after.address as address
FROM [mytable]
without having to manually specify the <root.leaf> as <leaf> clauses. I'm looking for something like:
SELECT after.* as <column suffix> from `mytable`
Is this possible?
EDIT: Additional info below
Note that my goal here is to remove the after prefix in the field names of the output (i.e. after.name or after_name becomes name).
after.*does not give the expected results. - Elliott Brossardafter.*does give me the expected result. but the output column forafter.namebecomesafter_nameand so on. I want the output columns to just bename,age,address, etc. without theafter_prefix. - Charles V.