Partial Rolled Up Aggregations in Bigquery
<p>Is there a way to do a rolled up aggregation on only certain <code>GROUP BY</code> columns instead of all <code>GROUP BY</code> columns?  Instead of <code>SELECT a,b,SUM(c) FROM sample.data GROUP BY a,b</code> or <code>SELECT a,b,SUM(c) FROM sample.data GROUP BY ROLLUP(a,b)</code>, I am trying to achieve <code>SELECT a,b,SUM(c) FROM sample.data GROUP BY a, ROLLUP(b)</code>.  Is this doable in BigQuery?</p>

<p>The only way I can imagine doing it right now is by creating a <code>GROUPING</code> column for each column I do not wish to be rolled up and filtering those columns to only <code>0</code>.  However, when trying this I get the error <code>Errors encountered during job execution.  Resources exceeded during query execution.</code> that I do not get when not including a <code>ROLLUP()</code>.  (Same error even with <code>GROUP EACH BY</code>.)</p>

<p>Thoughts?</p>