I have a table with the log data and I want to update it with the results from the subsequent query which will insert the results against the filtered row.
I want to use a union all to keep the current values and append the new ones but I get the following error:
Correlated subqueries that reference other tables are not supported unless they can be de-correlated, such as by transforming them into an efficient JOIN.
UPDATE LOGGING.table_logs a
SET a.pinged = ARRAY(
(SELECT AS STRUCT
CURRENT_TIMESTAMP() as date,b.size_bytes,timestamp_millis(b.last_modified_time) AS last_modified_time,b.row_count
FROM `<DATASETNAME>.__TABLES__` b WHERE table_id = CONCAT("ga_sessions_intraday_",FORMAT_DATE("%Y%m%d", CURRENT_DATE())))
)
WHERE table_id = CONCAT("ga_sessions_intraday_",FORMAT_DATE("%Y%m%d", CURRENT_DATE()))