We should add functional classes (Dataset, Table and Job) to gcloud-java-bigquery, to make using the library easier. Functional classes should allow something like:
// get an existing dataset
Dataset dataset = Dataset.load(bigquery, "my_dataset_id");
// create a table
Table table = dataset.create("my_table_id", Schema.of(field1, field2));
// copy a table
Job copyJob = table.copy(TableId.of("my_dataset_id", "my_copy_table_id");
// cancel a job
copyJob.cancel();
// load data into the table
Job loadJob = table.load(FormatOptions.csv(), ImmutableList.of("gs://my-bucket/my-file.csv"));
// wait for job to complete
while (!loadJob.isDone()) {
loadJob = loadJob.reload();
Thread.sleep(1000);
}
Comments are welcome:)
/cc @jtigani
We should add functional classes (
Dataset,TableandJob) to gcloud-java-bigquery, to make using the library easier. Functional classes should allow something like:Comments are welcome:)
/cc @jtigani