Corey Fritz created AVRO-2982:
---------------------------------

             Summary: Provide a null-safe alternative to DateAsLongEncoding
                 Key: AVRO-2982
                 URL: https://issues.apache.org/jira/browse/AVRO-2982
             Project: Apache Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.10.0
            Reporter: Corey Fritz


We ran into an issue today using {{DateAsLongEncoding}} on a {{java.util.Date}} 
field that could be null. Null values result in a {{NullPointerException}} 
during serialization while attempting to do the encoding to an Avro {{long}}.

This was easily overcome by implementing our own {{DateAsNullableLongEncoding}} 
that translates a {{java.util.Date}} field to an Avro union type: {{["null", 
"long"]}}. I'd like to contribute that solution back to this project.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to