8000 Document delay in table creation when insertAll is used with templateSuffix by mziccard · Pull Request #522 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,16 @@ public Builder ignoreUnknownValues(boolean ignoreUnknownValues) {
/**
* If specified, the destination table is treated as a base template. Rows are inserted into an
* instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of
* the instance table, using the schema of the base template table.
* the instance table, using the schema of the base template table. Table creation might take
* some time. To obtain table's information after {@link BigQuery#insertAll(InsertAllRequest)}
* is called use:
* <pre> {@code
* String suffixTableId = ...;
* BaseTableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
* while (suffixTable == null) {
* Thread.sleep(1000L);
* suffixTable = bigquery.getTable(DATASET, suffixTableId);
* }}</pre>
*
* @see <a
* href="https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables">
Expand Down Expand Up @@ -293,7 +302,16 @@ public Boolean skipInvalidRows() {
/**
* If specified, the destination table is treated as a base template. Rows are inserted into an
* instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of the
* instance table, using the schema of the base template table.
* instance table, using the schema of the base template table. Table creation might take some
* time. To obtain table's information after {@link BigQuery#insertAll(InsertAllRequest)} is
* called use:
* <pre> {@code
* String suffixTableId = ...;
* BaseTableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
* while (suffixTable == null) {
* Thread.sleep(1000L);
* suffixTable = bigquery.getTable(DATASET, suffixTableId);
* }}</pre>
*
* @see <a
* href="https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@ public void testInsertAllWithSuffix() throws InterruptedException {
assertEquals(0, response.insertErrors().size());
String newTableName = tableName + "_suffix";
BaseTableInfo suffixTable = bigquery.getTable(DATASET, newTableName, TableOption.fields());
// wait until the new table is created. If the table is never created the test will time-out
while (suffixTable == null) {
Thread.sleep(1000L);
suffixTable = bigquery.getTable(DATASET, newTableName, TableOption.fields());
}
assertNotNull(suff 49E8 ixTable);
assertTrue(bigquery.delete(TableId.of(DATASET, tableName)));
assertTrue(bigquery.delete(TableId.of(DATASET, newTableName)));
}
Expand Down
0