Skip to content

Commit c6d7983

Browse files
authored
---
yaml --- r: 8239 b: refs/heads/master c: 9a5f279 h: refs/heads/master i: 8237: a971553 8235: 4ce567a 8231: fbefd98 8223: cc35eec
1 parent 3c16a48 commit c6d7983

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 609a7990779e612ff5a1b0fec26c9ede16dc8881
2+
refs/heads/master: 9a5f2791bb1cce8493348a7069a04b5e571dc44f
33
refs/heads/travis: 47e4fee4fd5af9b2a8ce46f23c72ec95f9b195b2
44
refs/heads/gh-pages: 0114589947fea527ea3831330789accedbecf45c
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/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

trunk/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";

trunk/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)