title: How to exclude NULLs from ARRAY so query won't fail
body: <p><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#array_agg" rel="noreferrer">ARRAY_AGG</a> aggregate function includes <code>NULLs</code> in the arrays it builds. When such arrays are part of query result, query fails with error: </p>
  
  <blockquote>
    <p>Array cannot have a null element; error in writing field</p>
  </blockquote>
  
  <p>i.e. the following query demonstrates it:</p>
  
  <pre><code>#standardSQL
  SELECT ARRAY_AGG(x) FROM UNNEST([1,NULL,2,3]) x
  </code></pre>
  
  <p>How can we solve it ?</p>