0
votes

I'm performing the following extract query in CSV and it works perfectly:

EXPORT DATA
  OPTIONS ( uri = 'gs://my_bucket/test*.csv',
    format = 'CSV',
    overwrite = TRUE,
    header = TRUE
    field_delimiter = ','
    ) AS (
  SELECT
    collun1,
    collun2,
    collun3
  FROM
  My_table
);

I would like the same query but in Json format

EXPORT DATA
  OPTIONS ( uri = 'gs://my_bucket/test*.json',
    format = 'json',
    overwrite = TRUE,
    header = TRUE
    field_delimiter = ','
    ) AS (
  SELECT
    collun1,
    collun2,
    collun3
  FROM
  My_table
);

however it doesn't work the way I'm writing, I've looked in the bigquery documentation and haven't found the solution

json format is definitely supported. attributes like field_delimiter , header, etc. are not relevant/compatible with json format - that might be a source of issue you have - Mikhail Berlyant
What's the format of your JSON? - guillaume blaquiere