Skip to content

Commit 49b88e5

Browse files
authored
---
yaml --- r: 8339 b: refs/heads/snehashah-snippets c: 9a5f279 h: refs/heads/master i: 8337: ee93bd4 8335: cd781de
1 parent 112adde commit 49b88e5

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5656
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5757
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5858
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
59-
refs/heads/snehashah-snippets: 609a7990779e612ff5a1b0fec26c9ede16dc8881
59+
refs/heads/snehashah-snippets: 9a5f2791bb1cce8493348a7069a04b5e571dc44f
6060
refs/tags/v0.20.2: 5a53aa06f268b74dc192204f4f83e1a04d40f65d
6161
refs/tags/v0.20.3: 269025fdc14af0b68df214a4518be5379b2fe569
6262
refs/tags/v0.21.0: f88b200e00e41ba6262ee88a92abba38b1e2417e

branches/snehashah-snippets/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ Most `google-cloud` libraries require a project ID. There are multiple ways to
160160
5. The Google Cloud SDK project ID
161161
6. The Compute Engine project ID
162162

163+
In cases where the library may expect a project ID explicitly, we provide a helper that can provide the inferred project ID:
164+
```java
165+
import com.google.cloud.ServiceOptions;
166+
...
167+
String projectId = ServiceOptions.getDefaultProjectId();
168+
```
169+
163170
Authentication
164171
--------------
165172

branches/snehashah-snippets/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.bigquery.it;
1818

19+
import static com.google.cloud.bigquery.JobStatus.State.DONE;
1920
import static org.junit.Assert.assertArrayEquals;
2021
import static org.junit.Assert.assertEquals;
2122
import static org.junit.Assert.assertFalse;
@@ -1067,6 +1068,26 @@ public void testQueryJob() throws InterruptedException, TimeoutException {
10671068
assertNotNull(statistics.getQueryPlan());
10681069
}
10691070

1071+
@Test
1072+
public void testQueryJobWithDryRun() throws InterruptedException, TimeoutException {
1073+
String tableName = "test_query_job_table";
1074+
String query = new StringBuilder()
1075+
.append("SELECT TimestampField, StringField, BooleanField FROM ")
1076+
.append(TABLE_ID.getTable())
1077+
.toString();
1078+
TableId destinationTable = TableId.of(DATASET, tableName);
1079+
QueryJobConfiguration configuration = QueryJobConfiguration.newBuilder(query)
1080+
.setDefaultDataset(DatasetId.of(DATASET))
1081+
.setDestinationTable(destinationTable)
1082+
.setDryRun(true)
1083+
.build();
1084+
Job remoteJob = bigquery.create(JobInfo.of(configuration));
1085+
System.out.println("job (dryrun): " + remoteJob);
1086+
assertNull(remoteJob.getJobId().getJob());
1087+
assertEquals(DONE, remoteJob.getStatus().getState());
1088+
assertNotNull(remoteJob.getConfiguration());
1089+
}
1090+
10701091
@Test
10711092
public void testExtractJob() throws InterruptedException, TimeoutException {
10721093
String tableName = "test_export_job_table";

branches/snehashah-snippets/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ public void queryRealTable() {
583583
}
584584

585585
@Test
586+
@Ignore
586587
public void analyzePlan() {
587588
Statement statement = Statement.of("SELECT 1 AS column UNION ALL SELECT 2");
588589
ResultSet resultSet =
@@ -596,6 +597,7 @@ public void analyzePlan() {
596597
}
597598

598599
@Test
600+
@Ignore
599601
public void analyzeProfile() {
600602
Statement statement =
601603
Statement.of("SELECT 1 AS column UNION ALL SELECT 2 AS column ORDER BY column");

0 commit comments

Comments
 (0)