title: Google Bigquery: Partitioning specification needed for copying date partitioned table
body: <p>Note: this is nearly a duplicate of <a href="https://stackoverflow.com/questions/38852715/google-bigquery-incompatible-table-partitioning-specification">this question</a> with the distinction that in this case, the source table is date partitioned and the destination table does not yet exist.  Also, the accepted solution to that question didn't work in this case.</p>
  
  <p>I'm trying to copy a single day's worth of data from one date partitioned table into a new date partitoined table that I have not yet created.  My hope is that BigQuery would simply create the date-partitioned destination table for me like it usually does for the non-date-partitioned case.</p>
  
  <p>Using BigQuery CLI, here's my command:</p>
  
  <pre><code>bq cp mydataset.sourcetable\$20161231 mydataset.desttable\$20161231
  </code></pre>
  
  <p>Here's the output of that command:</p>
  
  <blockquote>
    <p>BigQuery error in cp operation: Error processing job
    'myproject:bqjob_bqjobid': Partitioning specification must be provided
    in order to create partitioned table</p>
  </blockquote>
  
  <p>I've tried doing something similar using the python SDK: running a select command on a date partitioned table (which selects data from only one date partition) and saving the results into a new destination table (which I hope would also be date partitioned).  The job fails with  the same error:</p>
  
  <blockquote>
    <p>{u'message': u'Partitioning specification must be provided in order to
    create partitioned table', u'reason': u'invalid'}</p>
  </blockquote>
  
  <p>Clearly I need to add a partitioning specification, but I couldn't find any documentation on how to do so.</p>