I am trying to write an update or merge BigQuery SQL to update the data_profile.name of table1 (repeated column) using another reference table having dataprofile data of table2 (flattendata).
Using SQL:
UPDATE `dataset.table_1`
SET data_profiles = ARRAY(
SELECT (
adp.id,dp.name
)
FROM UNNEST(data_profiles) AS adp join `dataset.table_2` dp on adp.id =dp.id
)
WHERE true
but we want to update only the data_profile.name which got updated in SOURCE TABLE to avoid updation on all columns.
Please suggest any merge or update statement for this scenario.

You're trying to update an array_agg struct with an array, try something like this: