title: How to create partitioned BigQuery table in Java
body: <p><a href="https://cloud.google.com/bigquery/docs/creating-partitioned-tables" rel="nofollow">https://cloud.google.com/bigquery/docs/creating-partitioned-tables</a> shows how to create partitioned table in Python. I've been there, I've done that.</p>
  
  <p>Now the question is, how to do the same thing with Java API? What is the corresponding Java code doing the same thing as the Python one below:</p>
  
  <pre><code>{
    "tableReference": {
      "projectId": "myProject",
      "tableId": "table1",
      "datasetId": "mydataset"
    },
    "timePartitioning": {
      "type": "DAY"
    }
  }
  </code></pre>
  
  <p>Java with missing partitioning:</p>
  
  <pre><code>Job createTableJob = new Job();
  JobConfiguration jobConfiguration = new JobConfiguration();
  JobConfigurationLoad loadConfiguration = new JobConfigurationLoad();
  
  createTableJob.setConfiguration(jobConfiguration);
  jobConfiguration.setLoad(loadConfiguration);
  
  TableReference tableReference = new TableReference()
      .setProjectId("myProject")
      .setDatasetId("mydataset")
      .setTableId("table1");
  
  loadConfiguration.setDestinationTable(tableReference);
  // what should be place here to set DAY timePartitioning?
  </code></pre>
  
  <p>I'm using the newest api version from Maven Central Repository: <code>com.google.apis:google-api-services-bigquery:v2-rev326-1.22.0</code>.</p>