1
votes

I have to upload a JSON load into the big query. While uploading the load I got the below-mentioned error.

I debug and found that it is failing on this JSON record which seems to be valid.

{"firebaseUid":"00FKNF7x2BQhDoPk9TSzE4Ncepn1","age_range":{"min":21},"signUpApp":"stationApp","uid":"00FKNF7x2BQhDoPk9TSzE4Ncepn1","locale":"en_US","emailSha256":"501a8456ececb2a50e733eed6c64b840d63d3aad99fb9ad4a1bbd2cbc33fc1f6","loginMethod":"facebook","notificationToken":"dummy","ageRangeMin":21,"pushNotificationEnabled":true,"projectId":"triplembaas","createDate":"13/07/2018","state":"QLD","station":"TripleM 104.5","facebookId":"1021TheHotBreakfast740157586","email":"[email protected]","cellularNetwork":"OPTUS","suburb":"Bellara","idfa":"60A63734A27E40249331658F1AC670A1","deviceId":"BBD901JaseJuelz454E100000000000000000","firstSignUpDate":"13/07/2018","name":"Harley Connolly","gender":"male","emailVerificationFlag":false,"lastUpdateDate":"20/07/2018","link":"dummy"}

Error while reading data, error message: JSON table encountered too many errors, giving up. Rows: 1; errors: 1. Please look into the error stream for more details.

1
How do you upload it? Maybe you need to include the header Content-Type: application/json in your upload-request. - Tobias K.
I'm uploading the file from my local. I have uploaded JSON data multiple times from my local to bigquery and it has succeeded without giving any headers. I don't think bigquery expects a header. - Sains
It needs to be newline-delimited JSON. In your question, it doesn't appear to be valid NDJSON. - Elliott Brossard
@ElliottBrossard Can you please point out where does it disqualify as ndjson? I uploaded a similar looking record and it worked. - Sains
The row's contents are spread across multiple lines, not just one... - Elliott Brossard

1 Answers

4
votes

Probably I am late but for anyone still looking for answer try this. Change your date format to "YYYY-MM-DD". Somehow bigquery detects that the field value is Date and it won't allow any other format of date instead of "YYYY-MM-DD"