You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Brent Payne <br...@cursivelabs.com> on 2016/01/19 00:07:47 UTC

Outputting one JSON record per newline

Thanks in advance for the project and any responses.

Problem behind the Problem:
I was hoping to write out some files for ingest via Redshift COPY from S3.
Redshift has an assumption of one JSON record per line.

The default drill json table writes files that look like this:

```
{
  "field1":  "value1",
   "metric_field": 10
}  {
  "field1":  "valueB",
   "metric_field": 21
}
```

Is there a way to configure this as one json record per line?

Re: Outputting one JSON record per newline

Posted by Brent Payne <br...@cursivelabs.com>.
Awesome, thanks

On Mon, Jan 18, 2016 at 3:14 PM, Jason Altekruse <al...@gmail.com>
wrote:

> An option was recently added to allow this as output, it is available in
> 1.4
>
> set this option value to true in your session/system to make JSON records
> print out one-per-line:
>
> alter session set `store.json.writer.uglify` = true;
>
> On Mon, Jan 18, 2016 at 3:07 PM, Brent Payne <br...@cursivelabs.com>
> wrote:
>
> > Thanks in advance for the project and any responses.
> >
> > Problem behind the Problem:
> > I was hoping to write out some files for ingest via Redshift COPY from
> S3.
> > Redshift has an assumption of one JSON record per line.
> >
> > The default drill json table writes files that look like this:
> >
> > ```
> > {
> >   "field1":  "value1",
> >    "metric_field": 10
> > }  {
> >   "field1":  "valueB",
> >    "metric_field": 21
> > }
> > ```
> >
> > Is there a way to configure this as one json record per line?
> >
>

Re: Outputting one JSON record per newline

Posted by Jason Altekruse <al...@gmail.com>.
An option was recently added to allow this as output, it is available in 1.4

set this option value to true in your session/system to make JSON records
print out one-per-line:

alter session set `store.json.writer.uglify` = true;

On Mon, Jan 18, 2016 at 3:07 PM, Brent Payne <br...@cursivelabs.com> wrote:

> Thanks in advance for the project and any responses.
>
> Problem behind the Problem:
> I was hoping to write out some files for ingest via Redshift COPY from S3.
> Redshift has an assumption of one JSON record per line.
>
> The default drill json table writes files that look like this:
>
> ```
> {
>   "field1":  "value1",
>    "metric_field": 10
> }  {
>   "field1":  "valueB",
>    "metric_field": 21
> }
> ```
>
> Is there a way to configure this as one json record per line?
>