从位置0开始的行中的JSON解析错误.行大小大于:2097152 [英] JSON parsing error in row starting at position 0: . Row size is larger than: 2097152

查看:89
本文介绍了从位置0开始的行中的JSON解析错误.行大小大于: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆