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

Thomas Groh resolved BEAM-44.
-----------------------------
    Resolution: Fixed

> Return the input coder in NullableCoder.of() if it is a NullableCoder
> ---------------------------------------------------------------------
>
>                 Key: BEAM-44
>                 URL: https://issues.apache.org/jira/browse/BEAM-44
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Thomas Groh
>            Assignee: Thomas Groh
>            Priority: Trivial
>
> {{NullableCoder.of(NullableCoder.of(foo))}} returns a nested 
> {{NullableCoder}}, which appends two "present" bytes before null values. The 
> second coder is unnecessary, and does not need to be provided. Instead, in 
> the factory method, return the input coder if it is already a 
> {{NullableCoder}}.
> {code}
> NullableCoder<T> of(Coder<T> coder) {
>   if (coder instanceof NullableCoder) return coder;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to