Skip to content
Merged
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 @@ -20,6 +20,7 @@
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkState;

import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.util.BackOff;
Expand Down Expand Up @@ -451,6 +452,12 @@ public void createNewDataset(
new IOException(
"Expected valid response from insert dataset job, but received null.");
}
} catch (GoogleJsonResponseException e) {
if (e.getStatusCode() == 409) {
LOG.info("Dataset {} already exists, treating as success.", datasetId);
return;
}
lastException = e;
} catch (IOException e) {
// ignore and retry
lastException = e;
Expand Down Expand Up @@ -509,6 +516,16 @@ public void createNewTable(String projectId, String datasetId, Table newTable)
lastException =
new IOException("Expected valid response from create table job, but received null.");
}
} catch (GoogleJsonResponseException e) {
if (e.getStatusCode() == 409) {
LOG.info(
"Table {}:{}.{} already exists, treating as success.",
projectId,
datasetId,
newTable.getTableReference().getTableId());
return;
}
lastException = e;
} catch (IOException e) {
// ignore and retry
lastException = e;
Expand Down
Loading