The following code snippet shows the writing method to BigQuery (it picks up data from PubSub). The "Write to BigQuery" dataflow step receives the TableRow data but it writes to BigQuery with very high delay (more than 3-4 hours) or doesn't even write the data at all. There are no errors/warnings in log and I can see the data arrived here. I wanted it as generic as possible so don't want to provide the schema in the code. Does this code snippet have any bug that can cause this behavior?
PCollection<TableRow> tableRows;
...
tableRows.apply("Write to BigQuery",
BigQueryIO.writeTableRows().to(options.getTable())
.withExtendedErrorInfo()
.withCreateDisposition(CreateDisposition.CREATE_NEVER)
.withWriteDisposition(WriteDisposition.WRITE_APPEND)
.withMethod(Method.STREAMING_INSERTS)
.withFailedInsertRetryPolicy(InsertRetryPolicy.retryTransientErrors()));
UPDATE: I modified the code to this:
tableRows.apply("Write to BigQuery",
BigQueryIO.writeTableRows().to(options.getTable())
.withCreateDisposition(CreateDisposition.CREATE_NEVER));
And now it works correctly. What was the problem with the original version of code?