Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上,我不需要 DoFn 的输出,只想为我在 DoFn 中获得的每条记录更新一些 mysql 数据库。那么如何定义具有 void 数据类型的 DoFn 呢?基本上我不想从 DoFn 发出任何东西。
这不可能。一旦 Crunch 为执行生成图表,它就会确定是否有要写入的输出或要物化的数据(非常类似于操作)。即使要完成你想要的,你也需要做一个解决方法,比如创建一个DoFn<T,String>用于写入或实现来自 DoFn 的 PCollection 结果的代码,即使你已经知道不会有任何输出。
DoFn<T,String>