从位置0开始的行中的JSON解析错误.行大小大于:2097152 [英] JSON parsing error in row starting at position 0: . Row size is larger than: 2097152
问题描述
我们尝试从GoogleCloudStorage上传文件,但出现
We tried to upload a file from GoogleCloudStorage but got errors like
从位置0开始的行中的JSON解析错误.行大小大于:2097152.(错误代码:无效). 一行存储一万个客户数据.
JSON parsing error in row starting at position 0: . Row size is larger than: 2097152. (error code: invalid)`. Ten thousand of customers data are stored in oneline.
[{"user_id":1,"address": "london", "birthday":xxxx},{"user_id":2,"address": "london", "birthday":xxxx},{"user_id":3,"address": "NY", "birthday":xxxx},....{"user_id":10000,"address": "NY", "birthday":xxxx}]
推荐答案
为了将JSON从GCS加载到GBQ,您应该将数据转换为如下所示,每个用户信息都放在单独的行中-这将解决行大小限制并符合newline delimited JSON
要求-详细了解受支持的 JSON格式 >
In order to load JSON from GCS to GBQ you should transform your data to look like below, with each user info in separate line - this will address row size limit and will comply with newline delimited JSON
requirement - See more about supported JSON format
{"user_id":1,"address": "london", "birthday":xxxx}
{"user_id":2,"address": "london", "birthday":xxxx}
{"user_id":3,"address": "NY", "birthday":xxxx}
....
{"user_id":10000,"address": "NY", "birthday":xxxx}
这篇关于从位置0开始的行中的JSON解析错误.行大小大于:2097152的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!