> On Feb. 18, 2013, 5:51 a.m., Prashant Kommireddi wrote:
> > src/org/apache/pig/builtin/ToJson.java, line 40
> > <https://reviews.apache.org/r/9481/diff/2/?file=259422#file259422line40>
> >
> >     This can also be lazily created (once only)?
> 
> Russell Jurney wrote:
>     It can't be created once because it must be parametized by baos.
> 
> Russell Jurney wrote:
>     Thanks, I did this too.

Actually, this one does not work. The json output is bad, even when I flush.


> On Feb. 18, 2013, 5:51 a.m., Prashant Kommireddi wrote:
> > src/org/apache/pig/builtin/ToJson.java, line 38
> > <https://reviews.apache.org/r/9481/diff/2/?file=259422#file259422line38>
> >
> >     This could probably be constructed lazily only once. Something like
> >     
> >     ByteArrayOutputStream baos;
> >     
> >     if(baos == null) {
> >         baos = new ByteArrayOutputStream(BUF_SIZE);
> >     }
> 
> Russell Jurney wrote:
>             ByteArrayOutputStream baos;
>             if(baos == null) {
>                 baos = new ByteArrayOutputStream(BUF_SIZE);
>             } 
>     
>     does not parse
> 
> Russell Jurney wrote:
>     Thanks, I did this.

I had to do baos.reset() each execution to reuse this.


- Russell


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9481/#review16700
-----------------------------------------------------------


On Feb. 18, 2013, 11:03 p.m., Russell Jurney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9481/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2013, 11:03 p.m.)
> 
> 
> Review request for pig, Ashutosh Chauhan, Dmitriy Ryaboy, Alan Gates, 
> Jonathan Coveney, and Bill Graham.
> 
> 
> Description
> -------
> 
> This patch is for JIRA, https://issues.apache.org/jira/browse/PIG-2641 
> PIG-2641 - which adds a ToJson builtin based on the serialization in 
> JsonStorage.
> 
> 
> This addresses bug PIG-2641.
>     https://issues.apache.org/jira/browse/PIG-2641
> 
> 
> Diffs
> -----
> 
>   src/org/apache/pig/builtin/JsonStorage.java 56086ff 
>   src/org/apache/pig/builtin/ToJson.java PRE-CREATION 
>   test/org/apache/pig/test/TestToJson.java PRE-CREATION 
>   test/org/apache/pig/test/data/jsonStorage1.tojson PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/9481/diff/
> 
> 
> Testing
> -------
> 
> This works for me locally, and there is a working unit test.
> 
> 
> Thanks,
> 
> Russell Jurney
> 
>

Reply via email to