title: CREATE OR REPLACE TABLE using the Google BigQuery Python library
body: <p>My Python code is like so: </p>
  
  <pre><code>from google.cloud import bigquery
  
  client = bigquery.Client(
                          project='my-project',
                          credentials=credentials,
                          )
  sql = '''
          CREATE OR REPLACE TABLE `my-project.my_dataset.test` AS
              WITH some_table AS (
                SELECT * FROM `my-project.my_dataset.table_1` 
              ),
              some_other_table AS (
                SELECT id, some_column FROM my-project.my_dataset.table_2
              )
              SELECT * FROM some_table 
              LEFT JOIN some_other_table ON some_table.unique_id=some_other_table.id
          '''
  
  query_job = client.query(sql)
  
  query_job.result()
  </code></pre>
  
  <p>The query works in the Google BigQuery Console UI, but not when executed as above from Python.</p>
  
  <p>I understand that by using CREATE OR REPLACE this is a "DDL" request, which I cannot figure out how to execute from the Python library. You can set the destination table in the job.config, which lets you CREATE a table, but then you don't get the CREATE OR REPLACE functionality. </p>
  
  <p>Thanks for any assistance.</p>