title: How to do repeatable sampling in BigQuery Standard SQL?
body: <p>In <a href="https://www.oreilly.com/learning/repeatable-sampling-of-data-sets-in-bigquery-for-machine-learning" rel="noreferrer">this blog</a> a Google Cloud employee explains how to do repeatable sampling of data sets for machine learning in BigQuery.  This is very important for creating (and replicating) train/validation/test partitions of your data.</p>
  
  <p>However the blog uses Legacy SQL, which <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql" rel="noreferrer">Google has now deprecated</a> in favor of Standard SQL.</p>
  
  <p>How would you re-write the blog's sampling code shown below, but using Standard SQL?</p>
  
  <pre><code>#legacySQL
  SELECT
    date,
    airline,
    departure_airport,
    departure_schedule,
    arrival_airport,
    arrival_delay
  FROM
    [bigquery-samples:airline_ontime_data.flights]
  WHERE
    ABS(HASH(date)) % 10 &lt; 8
  </code></pre>