You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Stephen Sisk (JIRA)" <ji...@apache.org> on 2017/04/20 16:31:04 UTC

[jira] [Commented] (BEAM-1166) Source.getDefaultOutputCoder() - hard to implement for adapter style sources

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

Stephen Sisk commented on BEAM-1166:
------------------------------------

I'm adapting this bug a bit since it's become clear that this is more complicated than initially thought. 

We are able to just return CannotProvideCoderException from any ptransform. However, Sources are not PTransforms and there are places we use Sources that currently don't expect CannotProvideCoderException. We believe this should be fixable, but it's unclear how far the change will ripple out.

For reference: PTransforms, getDefaultOutputCoder is ultimately called by https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/values/TypedPValue.java#L136 for PTransforms

Fix option 1: consider passing coder registry to getDefaultOutputCoder - that way getDefaultOutputCoder in sources can at least consult the coder registry easily. (the short term work around for devs building sources is to grab the coder registry inside of a wrapping PTransform's expand method, then pass it into the source.)

Fix option 2: Do the original fix to allow source.getdefaultoutputcoder to throw CannotProvideCoderException

I think both are useful, passing in the coder registry is probably easier, but maybe not.

> Source.getDefaultOutputCoder() - hard to implement for adapter style sources
> ----------------------------------------------------------------------------
>
>                 Key: BEAM-1166
>                 URL: https://issues.apache.org/jira/browse/BEAM-1166
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Stephen Sisk
>            Assignee: Stephen Sisk
>
> Knowing that you can throw CannotProviderCoderException is an important part of implementing getDefaultOutputCoder
> The documentation for PTransform's getDefaultOutputCoder mentions this class, and we should do this for the Source class as well.



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