可以在Java中编写代码而不为每个PCollection换行吗?

huangapple go评论118阅读模式
英文:

Is it possible to write without breaking line for each pcollection in Java?

问题

我刚开始使用Java SDK的Apache Beam。由于需要在元素之间不断开行地写入文件,我正在尝试找到一种方法来实现这一点。

从下面的代码看,我觉得它有些相似,但我仍然找不到等价的选项。
https://stackoverflow.com/questions/50913942/beam-io-writetotext-add-new-line-after-each-value-can-it-be-removed

我正在尝试的是这个。

org.apache.beam.sdk.io.TextIO.write()

这种方法可行吗?

提前感谢您的帮助。

英文:

I've just started using Java SDK Apache beam.
As it is required to write files without breaking lines on elements, I'm trying to find a way to do it.

Looking at below, I kind of find it similar but still I can't find the equivalent option.
https://stackoverflow.com/questions/50913942/beam-io-writetotext-add-new-line-after-each-value-can-it-be-removed

What I'm trying with is this.

org.apache.beam.sdk.io.TextIO.write()

Is it possible?

Thanks in advance.

答案1

得分: 0

一个累加器,它扩展了CombineFn<InputT, AccumT, OutputT>,使其能够编写连接的字符串集合而不中断换行。

英文:

An accumator which extends CombineFn&lt;InputT, AccumT, OutputT&gt; led it write concatenated string sets without breaking line.

huangapple
  • 本文由 发表于 2020年3月16日 18:24:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/60704162.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定