You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by Anonymity🐜 <31...@qq.com> on 2021/03/15 07:35:37 UTC

stream load 导入json文件问题

请教一下各位大佬,doris的stream load写入json文件时,文件只有一条数据时,可以正常写入,当文件包含多条json object时,写入时收到如下异常:
Reason: Parse json data for JsonDoc failed. code = 2, error-info:The document root must not be followed by other values.. doris写入多条json数据的文件时,必须文件必须是json array,同时指定-H "strip_outer_array: true"吗? 我试了一下这样写入是能写入的。

回复: stream load 导入json文件问题

Posted by Anonymity🐜 <31...@qq.com>.
OK, thanks.




------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "dev"                                                                                    <lingmiao@apache.org&gt;;
发送时间:&nbsp;2021年3月15日(星期一) 下午4:07
收件人:&nbsp;"dev"<dev@doris.apache.org&gt;;

主题:&nbsp;Re: stream load 导入json文件问题



Hi,

&gt; Question translation:
When Doris' stream load imports data in json format, if the file contains
multiple json objects, it will report an error:
```Reason: Parse json data for JsonDoc failed. code = 2, error-info:The
document root must not be followed by other values```
When Doris writes multiple json data files, the file must be a json array
and specify -H "strip_outer_array: true" at the same time? I tried to write
in this way and it can be written.

Yes, if you want to import multiple pieces of json data at once, you need
to use the json array structure.

Ling Miao

Anonymity🐜 <313304469@qq.com&gt; 于2021年3月15日周一 下午3:35写道:

&gt; 请教一下各位大佬,doris的stream load写入json文件时,文件只有一条数据时,可以正常写入,当文件包含多条json
&gt; object时,写入时收到如下异常:
&gt; Reason: Parse json data for JsonDoc failed. code = 2, error-info:The
&gt; document root must not be followed by other values..
&gt; doris写入多条json数据的文件时,必须文件必须是json array,同时指定-H "strip_outer_array: true"吗?
&gt; 我试了一下这样写入是能写入的。

Re: stream load 导入json文件问题

Posted by ling miao <li...@apache.org>.
Hi,

> Question translation:
When Doris' stream load imports data in json format, if the file contains
multiple json objects, it will report an error:
```Reason: Parse json data for JsonDoc failed. code = 2, error-info:The
document root must not be followed by other values```
When Doris writes multiple json data files, the file must be a json array
and specify -H "strip_outer_array: true" at the same time? I tried to write
in this way and it can be written.

Yes, if you want to import multiple pieces of json data at once, you need
to use the json array structure.

Ling Miao

Anonymity🐜 <31...@qq.com> 于2021年3月15日周一 下午3:35写道:

> 请教一下各位大佬,doris的stream load写入json文件时,文件只有一条数据时,可以正常写入,当文件包含多条json
> object时,写入时收到如下异常:
> Reason: Parse json data for JsonDoc failed. code = 2, error-info:The
> document root must not be followed by other values..
> doris写入多条json数据的文件时,必须文件必须是json array,同时指定-H "strip_outer_array: true"吗?
> 我试了一下这样写入是能写入的。