Skip to content

Commit

Permalink
fix IT
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewang526 committed Jul 9, 2020
1 parent 2a835ec commit 30fe00c
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -258,6 +258,7 @@ public class ITBigQueryTest {
private static final String EXTRACT_MODEL_FILE = "extract_model.csv";
private static final String BUCKET = RemoteStorageHelper.generateBucketName();
private static final TableId TABLE_ID = TableId.of(DATASET, "testing_table");
private static final TableId TABLE_ID_FASTQUERY = TableId.of(DATASET, "fastquery_testing_table");
private static final String CSV_CONTENT = "StringValue1\nStringValue2\n";
private static final String JSON_CONTENT =
"{"
Expand Down Expand Up @@ -354,6 +355,17 @@ public static void beforeClass() throws InterruptedException, TimeoutException {
assertNull(job.getStatus().getError());
LoadJobConfiguration loadJobConfiguration = job.getConfiguration();
assertEquals(labels, loadJobConfiguration.getLabels());

LoadJobConfiguration configurationFastQuery =
LoadJobConfiguration.newBuilder(
TABLE_ID_FASTQUERY, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json())
.setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED)
.setSchema(TABLE_SCHEMA)
.setLabels(labels)
.build();
Job jobFastQuery = bigquery.create(JobInfo.of(configurationFastQuery));
jobFastQuery = jobFastQuery.waitFor();
assertNull(jobFastQuery.getStatus().getError());
}

@AfterClass
Expand Down Expand Up @@ -1424,7 +1436,7 @@ public void testFastQueryMultiPages() throws InterruptedException {

@Test
public void testFastDMLQuery() throws InterruptedException {
String tableName = TABLE_ID.getTable();
String tableName = TABLE_ID_FASTQUERY.getTable();
String dmlQuery =
String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName);
QueryJobConfiguration config =
Expand Down

0 comments on commit 30fe00c

Please sign in to comment.