beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu Mingmin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-1516) null value is not supported in Map with AvroCoder
Date Tue, 21 Feb 2017 17:53:44 GMT

    [ https://issues.apache.org/jira/browse/BEAM-1516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15876389#comment-15876389
] 

Xu Mingmin commented on BEAM-1516:
----------------------------------

would like to take this task if no duplication

> 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)

Mime
View raw message