use of com.google.cloud.bigquery.Job in project google-cloud-java by GoogleCloudPlatform.
the class ITTableSnippets method testCopyTableId.
@Test
public void testCopyTableId() {
Job copyJob = tableSnippets.copyTableId(COPY_DATASET_NAME, getCopyTableName());
assertSuccessful(copyJob);
}
use of com.google.cloud.bigquery.Job in project google-cloud-java by GoogleCloudPlatform.
the class ITTableSnippets method testExtractAndLoadList.
@Test
public void testExtractAndLoadList() {
String gcsFile1 = "gs://" + BUCKET_NAME + "/extractTestA_*.csv";
String gcsFile2 = "gs://" + BUCKET_NAME + "/extractTestB_*.csv";
Job extractJob = tableSnippets.extractList("CSV", gcsFile1, gcsFile2);
gcsFile1 = gcsFile1.replace("*", "000000000000");
gcsFile2 = gcsFile2.replace("*", "000000000000");
assertSuccessful(extractJob);
Job loadJob = tableSnippets.loadList(gcsFile1, gcsFile2);
assertSuccessful(loadJob);
}
use of com.google.cloud.bigquery.Job in project google-cloud-java by GoogleCloudPlatform.
the class ITJobSnippets method testExists.
@Test
public void testExists() throws Exception {
JobConfiguration jobConfig = QueryJobConfiguration.newBuilder(QUERY).setUseLegacySql(false).build();
JobInfo jobInfo = JobInfo.newBuilder(jobConfig).build();
Job job = bigquery.create(jobInfo);
JobSnippets jobSnippets = new JobSnippets(job);
boolean result = jobSnippets.exists();
assertTrue(result);
}
use of com.google.cloud.bigquery.Job in project google-cloud-java by GoogleCloudPlatform.
the class ITJobSnippets method testWaitFor.
@Test
public void testWaitFor() throws Exception {
JobConfiguration jobConfig = QueryJobConfiguration.newBuilder(QUERY).setUseLegacySql(false).build();
JobInfo jobInfo = JobInfo.newBuilder(jobConfig).build();
Job job = bigquery.create(jobInfo);
JobSnippets jobSnippets = new JobSnippets(job);
boolean result = jobSnippets.waitFor();
assertTrue(result);
}
use of com.google.cloud.bigquery.Job in project google-cloud-java by GoogleCloudPlatform.
the class ITJobSnippets method testCancel.
@Test
public void testCancel() {
JobConfiguration jobConfig = QueryJobConfiguration.newBuilder(QUERY).setUseLegacySql(false).build();
JobInfo jobInfo = JobInfo.newBuilder(jobConfig).build();
Job job = bigquery.create(jobInfo);
JobSnippets jobSnippets = new JobSnippets(job);
boolean result = jobSnippets.cancel();
assertTrue(result);
}
Aggregations