为Avroio作家添加标题和页脚
我们有一个要求将标题和页脚添加到输出AVRO文件中,但SDK似乎不支持它。对于Textio Writer,似乎具有该功能withHeader
和。
也就是说,在不创建单独的管道的情况下,最好的方法是什么?我尝试在作者之后添加另一个一步,但似乎假定该管道是在作者之后结束的。
We have a requirements to add a header and footer to a output avro file, but seems like the SDK doesn't support it. For TextIO writer, it seems to have that capability withHeader
and withFooter
.
That been said, what's the best way to do it without creating a separate pipeline? I tried add another step after the writer, but seems like the pipeline assumed to be ended after the writer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终通过扩展
filebasedsink
找到了解决方案。然后,我只能做
mypCollection.apply(“ header footer”,writefiles.to(new customavrosink(... header,footer ...)))
>Finally found a solution by extending
FileBasedSink
.Then I can just do
myPCollection.apply("header footer",WriteFiles.to(new CustomAvroSink(...header, footer...)))