beam-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Mayi <>
Subject Re: Cannot provide coder
Date Mon, 13 Mar 2017 15:28:42 GMT
to answer myself:
I should have said I am creating the PCollection<Data> using Create.of which apparently
leads to this getDefaultCoder() implementation: CoderRegistry.getDefaultCoder(T exampleValue) which
doesn't try inspecting the annotation (as opposed CoderRegistry.getDefaultCoder(Class<T>
clazz) ). So I guess I have to explicitly use the create.of().withCoder().

    On Monday, 13 March 2017, 13:37, Antony Mayi <> wrote:

trying to create PCollection of my custom data class but keep failing due to the CannotProvideCoderException:
My class is declared as follows:
@DefaultCoder(SerializableCoder.class) public class Data<DataT extends BaseData> implements
Serializable {
and it fails like this:
Caused by: org.apache.beam.sdk.coders.CannotProvideCoderException: Cannot provide coder based
on value with class my.project.Data: No CoderFactory has been registered for the class.
why it doesn't pick the coder?

View raw message