An additional piece of information that might be of interest:

This issue occurs if I try to create a PCollection with `beam.Create(s,
Execer{q, a})` but seems to work (at least with the direct runner) when I
emit the struct like `emit(Execer{q, a})`.

Tarrence

On Sat, Jul 31, 2021 at 3:36 PM Tarrence van As <[email protected]>
wrote:

> Hi,
>
> Thank you for the great work on Beam. I'm using the golang sdk and hoping
> someone might be able to help with defining a customer coder for a type.
>
> I have a type like this:
> type Execer struct {
> Query string `json:"query,omitempty"`
> Args []interface{} `json:"args,omitempty"`
> }
>
> Where each element in Args implements `driver.Valuer`.
>
> When trying to run with this as an element of a PCollection I get:
>
> panic: unable to encode type: interface {}
>
> My guess is that I need to define an encode/decode method for the type,
> but I'm not sure what interface it should implement. Any direction would be
> appreciated.
>
> Tarrence
>
>

Reply via email to