Skip to content

Commit c42b17f

Browse files
committed
---
yaml --- r: 2117 b: refs/heads/pubsub-alpha c: 46f7958 h: refs/heads/master i: 2115: 45b4621
1 parent 6c9196a commit c42b17f

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ refs/heads/master: 689bbb466df4b2d5d2483d6edb8ac5c7c7f7c6fa
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
6-
refs/heads/pubsub-alpha: 70b350cf8eb61a051adfd5cc9b10ffa952225ee6
6+
refs/heads/pubsub-alpha: 46f7958e2f39848469f7aa8537da42d707ed3585
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
88
refs/heads/update-datastore: 482954f2c5055231e5b3122ea91d2ba00ce8187c
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

branches/pubsub-alpha/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/InsertAllRequest.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,16 @@ public Builder ignoreUnknownValues(boolean ignoreUnknownValues) {
236236
/**
237237
* If specified, the destination table is treated as a base template. Rows are inserted into an
238238
* instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of
239-
* the instance table, using the schema of the base template table.
239+
* the instance table, using the schema of the base template table. Table creation might take
240+
* some time. To obtain table's information after {@link BigQuery#insertAll(InsertAllRequest)}
241+
* is called use:
242+
* <pre> {@code
243+
* String suffixTableId = ...;
244+
* BaseTableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
245+
* while (suffixTable == null) {
246+
* Thread.sleep(1000L);
247+
* suffixTable = bigquery.getTable(DATASET, suffixTableId);
248+
* }}</pre>
240249
*
241250
* @see <a
242251
* href="https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables">
@@ -293,7 +302,16 @@ public Boolean skipInvalidRows() {
293302
/**
294303
* If specified, the destination table is treated as a base template. Rows are inserted into an
295304
* instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of the
296-
* instance table, using the schema of the base template table.
305+
* instance table, using the schema of the base template table. Table creation might take some
306+
* time. To obtain table's information after {@link BigQuery#insertAll(InsertAllRequest)} is
307+
* called use:
308+
* <pre> {@code
309+
* String suffixTableId = ...;
310+
* BaseTableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
311+
* while (suffixTable == null) {
312+
* Thread.sleep(1000L);
313+
* suffixTable = bigquery.getTable(DATASET, suffixTableId);
314+
* }}</pre>
297315
*
298316
* @see <a
299317
* href="https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables">

branches/pubsub-alpha/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/ITBigQueryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,11 @@ public void testInsertAllWithSuffix() throws InterruptedException {
506506
assertEquals(0, response.insertErrors().size());
507507
String newTableName = tableName + "_suffix";
508508
BaseTableInfo suffixTable = bigquery.getTable(DATASET, newTableName, TableOption.fields());
509+
// wait until the new table is created. If the table is never created the test will time-out
509510
while (suffixTable == null) {
510511
Thread.sleep(1000L);
511512
suffixTable = bigquery.getTable(DATASET, newTableName, TableOption.fields());
512513
}
513-
assertNotNull(suffixTable);
514514
assertTrue(bigquery.delete(TableId.of(DATASET, tableName)));
515515
assertTrue(bigquery.delete(TableId.of(DATASET, newTableName)));
516516
}

0 commit comments

Comments
 (0)