Run a parameterized query

bq

  • The bq command-line tool is a Python-based command-line tool for BigQuery.
    More information: <https://cloud.google.com/bigquery/docs/reference/bq-cli-reference>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

bq query --use_legacy_sql=false --parameter='ts_value:TIMESTAMP:2016-12-07 08:00:00' 'SELECT TIMESTAMP_ADD(@ts_value, INTERVAL 1 HOUR)'

click the source code to copy