diff --git a/airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/writer/BigQueryTableWriter.java b/airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/writer/BigQueryTableWriter.java index 397983d945f7..dbc9027e6f52 100644 --- a/airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/writer/BigQueryTableWriter.java +++ b/airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/writer/BigQueryTableWriter.java @@ -51,10 +51,10 @@ public void close(boolean hasFailed) throws IOException { this.writeChannel.close(); try { Job job = writeChannel.getJob(); - /* while (!JobStatus.State.DONE.equals(job.getStatus())) { + while (job == null) { Thread.sleep(1000L); - job = job.reload(); - } */ + job = writeChannel.getJob(); + } if (job.getStatus().getError() != null) { throw new RuntimeException("Fail to complete a load job in big query, Job id: " + writeChannel.getJob().getJobId() + ", with error: " + writeChannel.getJob().getStatus().getError());