Hi Danny,

Thank you for your answer.

This code below doesn’t work for me:

register.Iter1[interface{}]()
register.DoFn3x1[context.Context, int, func(*interface{}) bool, 
error](&writeParquetFn{})

I'm having this error when trying to run on Dataflow:
```
bad input type
        caused by:
        encoding full type interface {}
bad type
        caused by:
unencodable type interface {}
```

Regards,

________________________________
From: Danny McCormick <[email protected]>
Sent: Friday, September 16, 2022 10:07 AM
To: [email protected] <[email protected]>; Rener Pereira De Castro 
<[email protected]>
Subject: Re: [Question] [Go SDK] Generic Register DoFn having iter(*interface{})

Hey Rener, you should be able to register that function with 
`register.DoFn3x1[context.Context, int, func(*interface{}) bool, error]`. You 
would use DoFn3x1 because you have 3 inputs and 1 output in your 
ProcessElement, and then the constraints are just the input types to your 
ProcessElement function.

Thanks,
Danny

On Fri, Sep 16, 2022 at 7:44 AM Rener Pereira De Castro via user 
<[email protected]<mailto:[email protected]>> wrote:
Hi guys,


I can't find a way to generic register a DoFn with ProcessElement like
parquetWriteFn -  ProcessElement(ctx context.Context, _ int, iter 
func(*interface{}) bool) 
(https://github.com/apache/beam/blob/30a48f05cf2ee0eea0a304fea01eb40f323f9f3c/sdks/go/pkg/beam/io/parquetio/parquetio.go#L150<https://protect2.fireeye.com/v1/url?k=31323334-501cfaeb-31350c47-454455535732-783c0a34be56f4a0&q=1&e=163b1df8-451a-4632-b4f9-df898c6a9902&u=https%3A%2F%2Fgithub.com%2Fapache%2Fbeam%2Fblob%2F30a48f05cf2ee0eea0a304fea01eb40f323f9f3c%2Fsdks%2Fgo%2Fpkg%2Fbeam%2Fio%2Fparquetio%2Fparquetio.go%23L150>)

I'm having this error:
```
bad input type
        caused by:
        encoding full type interface {}
bad type
        caused by:
unencodable type interface {}
```

Any help on that will be greatly appreciated


Regards,

[cid:1834667b7a75f2c7571]

Rener Castro
Data & Analytics
email: [email protected]<mailto:[email protected]>

[signature_1033755691]



Classificação: Interna


Classificação: Interna


Classificação: Interna


Classificação: Interna

Reply via email to