我是 Apache 梁的新手,我正在使用 Apache 梁,并在 GCP 中使用 Dataflow 作为运行程序。执行管道时出现以下错误。
coder of type class org.apache.beam.sdk.coders.ListCoder has a #structuralValue method which does not return true when the encoding of the elements is equal. Element [Person [businessDay=01042020, departmentId=101, endTime=2020-04-01T09:06:02.000Z, companyId=242, startTime=2020-04-01T09:00:33.000Z], Person [businessDay=01042020, departmentId=101, endTime=2020-04-01T09:07:47.000Z, companyId=242, startTime=2020-04-01T09:06:03.000Z], Person [businessDay=01042020, departmentId=101, endTime=2020-04-01T09:48:25.000Z, companyId=242, startTime=2020-04-01T09:07:48.000Z]]
PCollection 类似于 PCollection< KV < String,List < Person > > > 和 PCollection< KV < String,Iterable < List < Person > > >
我已经将 Person 实现为可序列化的 POJO 类并覆盖 equals 和 hash 方法。但我认为我还需要为 person 编写自定义 ListCoder 并在管道中注册。我不知道如何解决这个问题,请帮助。