Search in sources :

Example 6 with JobConfiguration

use of com.google.cloud.bigquery.JobConfiguration in project google-cloud-java by GoogleCloudPlatform.

the class ITJobSnippets method testWaitForWithOptions.

@Test
public void testWaitForWithOptions() 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.waitForWithOptions();
    assertTrue(result);
}
Also used : JobInfo(com.google.cloud.bigquery.JobInfo) Job(com.google.cloud.bigquery.Job) QueryJobConfiguration(com.google.cloud.bigquery.QueryJobConfiguration) JobConfiguration(com.google.cloud.bigquery.JobConfiguration) Test(org.junit.Test)

Example 7 with JobConfiguration

use of com.google.cloud.bigquery.JobConfiguration in project google-cloud-java by GoogleCloudPlatform.

the class ITJobSnippets method testReloadStatus.

@Test
public void testReloadStatus() 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);
    JobStatus.State result = jobSnippets.reloadStatus();
    assertEquals(JobStatus.State.DONE, result);
}
Also used : JobStatus(com.google.cloud.bigquery.JobStatus) JobInfo(com.google.cloud.bigquery.JobInfo) Job(com.google.cloud.bigquery.Job) QueryJobConfiguration(com.google.cloud.bigquery.QueryJobConfiguration) JobConfiguration(com.google.cloud.bigquery.JobConfiguration) Test(org.junit.Test)

Example 8 with JobConfiguration

use of com.google.cloud.bigquery.JobConfiguration in project google-cloud-java by GoogleCloudPlatform.

the class ITJobSnippets method testReload.

@Test
public void testReload() 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);
    JobStatus.State result = jobSnippets.reload();
    assertEquals(JobStatus.State.DONE, result);
}
Also used : JobStatus(com.google.cloud.bigquery.JobStatus) JobInfo(com.google.cloud.bigquery.JobInfo) Job(com.google.cloud.bigquery.Job) QueryJobConfiguration(com.google.cloud.bigquery.QueryJobConfiguration) JobConfiguration(com.google.cloud.bigquery.JobConfiguration) Test(org.junit.Test)

Aggregations

Job (com.google.cloud.bigquery.Job)8 JobConfiguration (com.google.cloud.bigquery.JobConfiguration)8 JobInfo (com.google.cloud.bigquery.JobInfo)8 QueryJobConfiguration (com.google.cloud.bigquery.QueryJobConfiguration)8 Test (org.junit.Test)7 JobStatus (com.google.cloud.bigquery.JobStatus)2 BigQueryException (com.google.cloud.bigquery.BigQueryException)1