https://cloud.google.com/bigquery/docs/creating-partitioned-tables shows how to create partitioned table in Python. I've been there, I've done that.
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:
{
"tableReference": {
"projectId": "myProject",
"tableId": "table1",
"datasetId": "mydataset"
},
"timePartitioning": {
"type": "DAY"
}
}
Java with missing partitioning:
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?
I'm using the newest api version from Maven Central Repository: com.google.apis:google-api-services-bigquery:v2-rev326-1.22.0
.