How to fix Dataflow unable to serialize my DoFn?

后端 未结 2 1143
抹茶落季
抹茶落季 2020-12-17 20:16

When I run my Dataflow pipeline, I get the exception below complaining that my DoFn can\'t be serialized. How do I fix this?

Here\'s the stack trace:



        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 21:04

    To add to what Jeremy says...

    Another common cause of Serializable issues is when you use an anonymous DoFn within a non-static context. Anonymous inner classes have an implicit pointer to the enclosing class, which will cause it to get serialized as well.

提交回复
热议问题