Skip to content

BigQuery: data is sometimes not inserted in tables #4007

@z0mg

Description

@z0mg

Hi,

I'm having random data missing/not showing up in BigQuery issues. I would seemingly write data without issues, but SELECT * would return nothing.

  1. Have tried latest version but still same issue.
<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-bigquery</artifactId>
  <version>2.28.0</version> 
</dependency>
  1. Linux and Windows
  2. JDK 8.202

Steps to reproduce

Issue is random, can't reproduce reliably. The writes are batched to 1-2k rows and 99% they work.

The control panel shows no errors. None of the quotas show up as exceeded. I get no exceptions and response.getInsertErrors() is always null. The issue seems to happen when doing intensive writes, as less batches per minute of the same size work fine.

Any ideas what's wrong? thank you.

Code example

GoogleCredential credential = new GoogleCredential.Builder().setTransport(new NetHttpTransport())
    .setJsonFactory(new JacksonFactory())
    .setClientSecrets("clientId", "clientSecret")
    .build()
    .setFromTokenResponse(new TokenResponse().setRefreshToken("refreshToken");

Bigquery bigquery = new Bigquery.Builder(new NetHttpTransport(), new JacksonFactory(), credential)
    .setApplicationName("name").build();

List<TableDataInsertAllRequest.Rows> rowList = new ArrayList<TableDataInsertAllRequest.Rows>();

TableRow rowWrapper = new TableRow();
rowWrapper.set("date", item.GetDate());
rowWrapper.set("value", item.GetValue());

TableDataInsertAllRequest.Rows insertRowRequest = new TableDataInsertAllRequest.Rows();

rowList.add(insertRowRequest);

TableDataInsertAllRequest content = new TableDataInsertAllRequest().setRows(rowList);

InsertAll op = bigquery.tabledata().insertAll("project", "dataset", "table", content);
    
TableDataInsertAllResponse response = op.execute();
if (response.getInsertErrors() == null)
{
  ; // all good
}
// example

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/java-bigquery API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions