osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Go SDK: bad parameter type for reflect.methodValueCall: func(Record)


I have the following code:

type Record struct {
       Timestamp time.Time
       Payload   string
}

type processFn struct {
        // etc...
}

func (f *processFn) ProcessElement(ctx context.Context, data []byte, emit func(Record)) {
         // etc..
         emit(someRecord)
         // etc...
}

Which is eventually invoked as:
beam.ParDo(scope, &processFn{}, pcoll)

This seems to work fine using the direct runner until I add a map to the Record struct as follows:

type Record struct {
        Timestamp    time.Time
        Payload      string
        Labels       map[string]string
}

Then I get the error mentioned in the subject line.

My questions are:
- Are maps illegal? What is a legal structure? or
- Is the feature yet to be implemented? or
- Am I doing something wrong? Am I failing to setup my pipeline correctly?
	
Thanks for your help.