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

Jeff Klukas commented on BEAM-1891:
-----------------------------------

Perhaps a better path is to write an AutoValueExtension that instead of adding 
an additional class in the hierarchy generates a `Coder` for the AutoValue 
class.

We could create a GenerateCoder annotation that would trigger the extension, 
read the parameters of the AutoValue class and generate a Coder that serializes 
those parameters in their order of definition. Deserialization would read in 
that same order and call the package-private constructor of the concrete 
AutoValue class.

 

> Java @Autovalue: currently doesn't have a good coder
> ----------------------------------------------------
>
>                 Key: BEAM-1891
>                 URL: https://issues.apache.org/jira/browse/BEAM-1891
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Stephen Sisk
>            Priority: Minor
>              Labels: newbie, starter
>
> In Java, @AutoValue classes are something that we would like developers to be 
> able to use in PCollections in Beam.
> However, there doesn't appear to be a good existing Beam Coder for Autovalue 
> generated classes:
> * Avrocoder doesn't work
> * Serializable Coder works, but has other problems (larger/less efficient)
> This is discussed fully at 
> https://lists.apache.org/thread.html/29617096819824d5c12247a246d316b763d9e583a21fff2f1c430077@%3Cdev.beam.apache.org%3E
>  
> We may need to implement an AutoValueCoder.
> cc [~pabloem] [~bchambers]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to