MERGE table1 M USING (
select _id,ARRAY(SELECT AS STRUCT value from unnest(preferences) as p where p.name="sendOnly") as prefer from table2
) S ON M._ID = S._ID WHEN MATCHED THEN
UPDATE
SET
M._ID = S._ID,
M.preferences_testing=s.prefer // here getting error
WHEN NOT MATCHED THEN INSERT (
_ID,
preferences_testing
)
VALUES
(
_ID,
prefer
)
getting error while converting the array struct to string , I tried to convert ARRAY<STRUCT> to String but nothing worked