Skip to content

Invalid Statistics type for Load job #2357

Description

@Syed-SnapLogic

Hi,
I have following code snippet in my project.

Credentials c = new ServiceAccountCredentials();  /* hiding credentials here*/
 BigQueryOptions options = BigQueryOptions.newBuilder().setCredentials(c).setProjectId('id').build();
 BigQuery bq = options.getService();
 TableId id = TableId.of('project id', 'dataset id', 'table id');
 Table t = bq.getTable(id);
 t.load(FormatOptions.csv(), "gs://bucket/file1.csv");
 System.out.println(loadJob.getStatistics());

I was expecting the statistics to be of 'Load' type but its of 'Copy' type.

Can anyone tell me where am I doing wrong? Indeed, data is getting inserted into table but I am missing the output statistics (no of rows, no of bytes, etc) due to wrong type being returned.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions