I have a bigquery table \'metrics\' which has nested record fields One of the fields is called resource.labels which has key pair values as
Try below- should work
UPDATE `project.dataset.metrics` SET resource = ( SELECT AS STRUCT * REPLACE( ARRAY( SELECT AS STRUCT key, IF(key='machinetype' and value='N/A', 'g1.small', value) as value FROM t.labels ) AS labels) FROM UNNEST([resource]) t ) WHERE true