[ 
https://issues.apache.org/jira/browse/AVRO-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rob Turner updated AVRO-1397:
-----------------------------

    Attachment: AVRO-1398.patch

Sorry about the whitespace changes, is there a formatter for Eclipse?

h4. Corrected Patch
Corrected my initial patch so that BinaryFragmentToJsonTool now pretty prints 
by default and I have added a --no-pretty option. I also added the 
--schema-file option to both BinaryFragmentToJsonTool and 
JsonToBinaryFragmentTool.

h4. JSON Pretty Printing
I added a method EncoderFactory.jsonEncoder(Schema schema, OutputStream out, 
boolean pretty) and changed JsonEncoder to create an extended 
DefaultPrettyPrinter that uses a line.separator as the root value separator 
rather than a space that is hard coded in DefaultPrettyPrinter. This could be 
used to provide a pretty print option for the tojson tool AVRO-1396.

h4. JsonToBinaryFragmentTool Catches EOFException 
This appears to be the only way to detect the end of the file, it is only 
thrown if the JSON parser has no more tokens and the stack depth is at the root 
level. A truncated JSON object throws a JsonParseException. The fromjson tool 
uses this method too.

Please review this patch.



> Binary fragment tools should allow more than one datum or JSON object
> ---------------------------------------------------------------------
>
>                 Key: AVRO-1397
>                 URL: https://issues.apache.org/jira/browse/AVRO-1397
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Rob Turner
>            Priority: Minor
>         Attachments: AVRO-1397.patch, AVRO-1397.patch, AVRO-1398.patch
>
>
> It would be useful for the binary fragment tools to process more than one 
> datum or JSON object. 



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to