ARRAY_AGG aggregate function includes NULLs
in the arrays it builds. When such arrays are part of query result, query fails with error:
Array cannot have a null element; error in writing field
i.e. the following query demonstrates it:
#standardSQL
SELECT ARRAY_AGG(x) FROM UNNEST([1,NULL,2,3]) x
How can we solve it ?