0
votes

I need to create a repository to work with Bigquery, so when I try to do an update or delete I take the following exception.

UPDATE or DELETE DML statements are not supported over table with streaming buffer

This exception only occurs after I insert something into the table, and the streaming buffer stays open for a long time even without inserting anything. Is it possible to terminate it?

Update Code

String query = "UPDATE " + DATASET_NAME + ".Report"
                + " type = 'AAAAAA'"
                + " WHERE id = 1";

QueryRequest queryRequest =
                QueryRequest
                        .newBuilder(query)
                        .setUseLegacySql(false)
                        .build();

Insert Code

Map<String, Object> content = parsePojoToMap(pojo);
        content.put("id", id);
InsertAllRequest.RowToInsert row =
                InsertAllRequest.RowToInsert
                        .of(id, content);
InsertAllRequest insertRequest =
                InsertAllRequest
                        .newBuilder(DATASET_NAME, getType().getSimpleName())
                        .addRow(row)
                        .build();
InsertAllResponse response = getInstance().insertAll(insertRequest);
1

1 Answers

0
votes

DML statements are not allowed on a table with an active streaming buffer. When no more data is streamed for some time, then the buffer is detached and DML is allowed. It usually takes 90 minutes after your last streaming insert for the streaming buffer to be detached. I haven't seen a way to terminate it unfortunately. If you do bulk operations there is no streaming buffer and you can perform DML operations immediately.