You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Xu Mingmin (JIRA)" <ji...@apache.org> on 2017/03/13 18:14:41 UTC

[jira] [Resolved] (BEAM-1516) null value is not supported in Map with AvroCoder

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

Xu Mingmin resolved BEAM-1516.
------------------------------
       Resolution: Not A Bug
    Fix Version/s: Not applicable

> 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
>             Fix For: Not applicable
>
>
> 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)