2
votes

When getting table content in CSV, null columns get dropped in output. Example:

curl -X GET -H "Authorization: Bearer TOKEN" “https://www.googleapis.com/bigquery/v2/projects/PROJ_NAME/datasets/DATASET_NAME/tables/TESTNULL/data?alt=csv&startIndex=0&maxResults=10000

the output is:

1,2,3

2,3,4

3,5

5

5,6

TESTNULL table contains 3 integer columns:

Row f1 f2 f3
1 1 2 3
2 2 3 4
3 3 null 5
4 null null 5
5 5 6 null

The same query with alt=json works fine. Ideas? Thanks.

1
Just a question, maybe I'm dense... but how did you get the alt param for the request? I see it nowhere in the docs about the Rest APIPatrice
I've never seen a rest api either. if you google "bigquery get data in csv" or something similar, some posts will mention the alt=... parameterBing Zheng
my point is that the official BQ doc (cloud.google.com/bigquery/docs/reference/v2/tables/list), there's nothing about that parameter, so I'm just trying to find something that explains the behaviorPatrice

1 Answers

1
votes

This is a bug in the alt=csv output for table data list. The root cause has been identified and we are now tracking this issue in our internal bug tracker.

Thank you for the report!