I've got the following BigQuery schema, and I'm trying to update the event_dim.date
field:
I tried the following query using standard SQL and the new BigQuery DML:
UPDATE `sara-bigquery.examples.app_events_20170113`
SET event_dim.date = '20170113'
WHERE true
But got this error:
Error: Cannot access field date on a value with type ARRAY<STRUCT<name STRING, params ARRAY<STRUCT<key STRING,
value STRUCT<string_value STRING, int_value INT64, float_value FLOAT64, ...>>>, timestamp_micros INT64, ...>> at [2:15]
I'm able to select the nested field with this query:
SELECT x.date FROM `sara-bigquery.examples.app_events_20170113`,
UNNEST(event_dim) x
But can't figure out the correct UPDATE
syntax.