google-cloud-dataflow - 使用 DirectRunner 测试数据流并获得大量 verifyUnmodifiedThrowingCheckedExceptions

标签 google-cloud-dataflow apache-beam

我正在使用 Mac 上的 DirectRunner 测试我的数据流管道,并收到了很多这样的“警告”消息,我是否知道如何摆脱它们,因为太多了,我什至看不到我的调试消息。

谢谢

Apr 05, 2018 2:14:48 PM org.apache.beam.sdk.util.MutationDetectors$CodedValueMutationDetector verifyUnmodifiedThrowingCheckedExceptions
WARNING: Coder of type class org.apache.beam.sdk.coders.SerializableCoder has a #structuralValue method which does not return true when the encoding of the elements is equal. 
Element com.apigee.analytics.platform.core.service.schema.EventRow@4a590d0b

最佳答案

确保所有序列化值都具有正确的 equals() 可能会有所帮助。自 SerializableCoder 以来的实现expects他们:

The structural value of the object is the object itself. The SerializableCoder should be only used for objects with a proper Object#equals implementation.



您可以实现自己的 Coder为您的 POJO。根据 docs,SerializableCoder 不保证确定性编码:

SerializableCoder does not guarantee a deterministic encoding, as Java serialization may produce different binary encodings for two equivalent objects.



This article explains custom coders in details .

关于google-cloud-dataflow - 使用 DirectRunner 测试数据流并获得大量 verifyUnmodifiedThrowingCheckedExceptions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49681787/

相关文章:

java - 从数据流中的 PubsubMessage 获取属性

Go SDK Apache Beam : singleton side input Singleton for int ill-defined

java - 即使我正在传递 View ,"calling sideInput() with unknown view"异常?

java - 无法传递 FileIO.Write/WriteFiles/WriteShardedBundlesToTempFiles/GroupIntoShards

google-cloud-platform - 无论如何在数据流管道中共享有状态变量?

google-cloud-dataflow - 用于在 Dataflow 中分组的自定义键

node.js - 使用云函数执行Dataflow模板时出错

parquet - 在 Apache Beam 中使用 Snappy 压缩写入 Parquet 文件

java - 无模式 JSON 到 Apache Beam "Row"类型?

python - 从 Bigquery 中读取几行作为辅助输入,得到 None