title: Require Partition Filter On BigQuery Views
body: <p>We have currently a couple of authorized views in the big query for various teams </p>
  
  <p>Currently, we are using <code>partition_date</code> column to use in the query to reduce the amount of data processed (<a href="https://stackoverflow.com/questions/44781767/bigquery-date-partitioned-views">reference</a>)</p>
  
  <pre><code>#standardSQL
  SELECT
    &lt;required_fields,...&gt;, 
    EXTRACT(DATE FROM _PARTITIONTIME) AS partition_date
  FROM
    `&lt;project-name&gt;.&lt;dataset-name&gt;.&lt;table-name&gt;`
  WHERE
    _PARTITIONTIME &gt;= TIMESTAMP("2018-05-01")
    AND _PARTITIONTIME &lt;= CURRENT_TIMESTAMP()
    AND &lt;Blah-Blah-Blah&gt;
  </code></pre>
  
  <p>However, due to the number of users &amp; data we have, it's very hard to maintain the quality of big query scripts leading us with increased query cost with the relatively increasing number of users. </p>
  
  <p>I see we can use <code>--require_partition_filter</code> (<a href="https://cloud.google.com/bigquery/docs/reference/bq-cli-reference" rel="nofollow noreferrer">reference</a>) when creating <code>TABLEs</code>. So, could someone help me address the following questions</p>
  
  <ul>
  <li>When I create a table with the above filter, does the referenced view will also expect the partition condition because of the partition filter enabled on the table level? </li>
  <li>Due to the number of authorized views connected to tables we have, it requires significant efforts to change it to materialized views (tables). Is there an alternative way possible to apply something similar/use like <code>--require_partition_filter</code> on view level? </li>
  </ul>
  
  <p>FYI, for someone who wants to update the current table with the above filter, I see we can use <code>bq update</code> command (<a href="https://stackoverflow.com/questions/49286366/how-to-set-big-query-require-partition-filter-in-bq-commandline">reference</a>) which I am planning to use for existing partitioned tables. </p>