title: elegant way to have sql query fail?
body: <p>I want to schedule a query in BigQuery that is dependent on some condition. I want the scheduled query to fail/throw an error when the condition is not met, so that the scheduler will sent an email that the query failed.</p>
  <p>I could do something like; 'SELECT 1/0 as error' or something similar but surely there is a better way to let a query fail or throw an error?</p>
  <p>Current SQL;</p>
  <pre><code>DECLARE row_count INT64;
  BEGIN
     SET row_count = ([SOME SELECT QUERY TO GET NUMBER OF ROWS]);
     IF row_count &gt; [somenumber] THEN
        [EXECUTE SOME DEPENDANT QUERY];
     ELSE
        SELECT 1/0 as error;
     END IF;
  END;
  </code></pre>