1

Im trying to push a json file to BQ via bqcmd which contains special chars such as ü but tis failing. Ive tried differnt encoding etc. nothing workign except removing the chars

 {
    "productName": "soft drüum",
    "Category": "xxxxxxx",
    "subCategory": "Sun & Tan",
    "subSubCategory": "Sun",
    "productType": "Standard",
    "brandName": "soft drüum",
    "quantity": 1
}

Json File was successful until introduction of special chars

BQ command:

bq load --autodetect=true --time_partitioning_field date
--source_format NEWLINE_DELIMITED_JSON Data.products D:\XXXX\xx\products.json
davey
  • 1,544
  • 4
  • 26
  • 41

1 Answers1

1

I would check to make sure that you have your json saved as new line delimited. In your example, the trailing comma is not valid in New Line Delimited JSON.

I was able to then upload these special characters via this command:

bq load --project_id=${project_id} --source_format NEWLINE_DELIMITED_JSON --autodetect ${database}.${table} ${nldjson_filename}
  • Apologies that trailing comma does not exist have removed it...Really you got it uploaded? i am using that exact bq command.. The newline delimited JSON file upload always worked but broke due to the introduction of the special chars – davey Feb 01 '22 at 15:46
  • You definitley get the ü char uploaded? – davey Feb 01 '22 at 17:20
  • BigQuery error in load operation: Error processing job 'xx-xxx-xxxxxxy- eu:bqjob_r1733e0c139aa0cd5_0000017eb64ed348_1': Error while reading data, error message: Failed to parse JSON: Expected , or } after key:value pair; Parser terminated before end of string – davey Feb 01 '22 at 17:29