Jeffrey Van Laethem
Jeffrey Van Laethem

Reputation: 2651

BigQuery EXPORT DATA as JSON, but Don't Wrap The Output With Column Name

I have a table in BigQuery that has a JSON column. I'd like to output that JSON to a file in GCS, using the EXPORT DATA statement in BigQuery. The issue is that the resulting file wraps the json from the table with the name of the column in the query.

For example, running this statement:

EXPORT DATA OPTIONS(
uri='gs://your-bucket-here/FILENAME*.json',
format='JSON',
overwrite=true
) AS SELECT JSON '{"attribute": "value"}';

results in the file containing this:

{"f0_":{"attribute":"value"}}

Is there a way to have it output the below instead?

{"attribute":"value"}

Upvotes: 0

Views: 27

Answers (0)

Related Questions