Xu Mingmin created BEAM-1516:
--------------------------------

             Summary: null value is not supported in Map with AvroCoder
                 Key: BEAM-1516
                 URL: https://issues.apache.org/jira/browse/BEAM-1516
             Project: Beam
          Issue Type: Bug
          Components: sdk-java-core
            Reporter: Xu Mingmin
            Assignee: Davor Bonaci


NullPointerException is thrown, when there's null value in a Map with AvroCoder.

The domain class is defined as below:
```
@DefaultCoder(AvroCoder.class)
public class RecordRow implements Serializable {
        private Map<String, String> dataMap = new HashMap<>();
        private RecordType dataType;
```

And the error message as:
```
Caused by: java.lang.NullPointerException: in *.beam.RecordRow in map in string 
null of string of map in field dataMap of *.beam.RecordRow
        at 
org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:152)
        at 
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:60)
        at org.apache.beam.sdk.coders.AvroCoder.encode(AvroCoder.java:296)
        at 
org.apache.beam.sdk.util.WindowedValue$FullWindowedValueCoder.encode(WindowedValue.java:663)
        at 
org.apache.beam.sdk.util.WindowedValue$FullWindowedValueCoder.encode(WindowedValue.java:603)
        at 
org.apache.beam.sdk.util.CoderUtils.encodeToSafeStream(CoderUtils.java:122)
        at 
org.apache.beam.sdk.util.CoderUtils.encodeToByteArray(CoderUtils.java:106)
        at org.apache.beam.sdk.util.CoderUtils.clone(CoderUtils.java:185)
```



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

Reply via email to