You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Daniel Halperin (JIRA)" <ji...@apache.org> on 2016/10/20 18:27:58 UTC

[jira] [Updated] (BEAM-44) Return the input coder in NullableCoder.of() if it is a NullableCoder

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

Daniel Halperin updated BEAM-44:
--------------------------------
    Labels: backward-incompatible  (was: )

> 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
>              Labels: backward-incompatible
>             Fix For: 0.1.0-incubating
>
>
> {{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)