[jira] [Commented] (AVRO-1582) Json serialization of nullable fileds and fields with default values improvement.

2017-05-24 Thread MihkelJ (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16022951#comment-16022951
 ] 

MihkelJ commented on AVRO-1582:
---

We ran up against this issue recently, so I've created a standalone encoder 
from Zoltan Farkas' excellent ExtendedJsonDecoder, until this issue is 
resolved: https://github.com/Celos/avro-json-decoder

It handles point b) from above, infers the value of missing fields from their 
defaults. The only advantage is that it doesn't require forked avro.

> Json serialization of nullable fileds and fields with default values 
> improvement.
> -
>
> Key: AVRO-1582
> URL: https://issues.apache.org/jira/browse/AVRO-1582
> Project: Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.0
>Reporter: Zoltan Farkas
> Attachments: AVRO-1582-PATCH
>
>
> Currently serializing a nullable field of type union like:
> "type" : ["null","some type"]
> when serialized as JSON results in:  
> "field":{"some type":"value"}
> when it could be:
> "field":"value"
> Also fields that equal the the default value can be omitted from the 
> serialized data. This is possible because the reader will have the writer's 
> schema and can infer the field values. This reduces the size of the json 
> messages.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Assigned] (AVRO-1990) CreateRandomFileTool should validate arguments

2017-05-24 Thread Nandor Kollar (JIRA)

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

Nandor Kollar reassigned AVRO-1990:
---

Assignee: Nandor Kollar

> CreateRandomFileTool should validate arguments
> --
>
> Key: AVRO-1990
> URL: https://issues.apache.org/jira/browse/AVRO-1990
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.0
>Reporter: Sean Busbey
>Assignee: Nandor Kollar
>  Labels: beginner
>
> Running CreateRandomFileTool without the {{--count}} argument results in a 
> NPE. it should instead give a useful error message.
> {code}
> java -jar lang/java/tools/target/avro-tools-1.9.0-SNAPSHOT.jar random 
> --schema '{ "type": "record", "name": "foobar", "fields": [ {"name": 
> "field0", "type": "string"}, {"name":"field2", "type":"int"}]}' 
> ~/Downloads/example.0.avro
> log4j:WARN No appenders could be found for logger 
> (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
> info.
> Exception in thread "main" java.lang.NullPointerException
>   at 
> org.apache.avro.tool.CreateRandomFileTool.run(CreateRandomFileTool.java:89)
>   at org.apache.avro.tool.Main.run(Main.java:87)
>   at org.apache.avro.tool.Main.main(Main.java:76)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)