我在使用 DataflowRunner 创建 Map PCollectionView 时遇到问题。
下面的管道将 unbouded 计数输入与来自侧输入的值(包含 10 个生成的值)聚合在一起。在 gcp 上运行管道时,它会卡在 View.asMap() 转换中。更具体地说, ParDo(StreamingPCollectionViewWriter) 没有任何输出。
我用 dataflow 2.0.0-beta3 和 beam-0.7.0-SNAPSHOT 尝试了这个,但没有任何结果。请注意,使用本地 DirectRunner 时,我的管道运行没有任何问题。
难道我做错了什么?感谢所有帮助,在此先感谢您帮助我!
public class SimpleSideInputPipeline {
private static final Logger LOG = LoggerFactory.getLogger(SimpleSideInputPipeline.class);
public interface Options extends DataflowPipelineOptions {}
public static void main(String[] args) throws IOException {
Options options = PipelineOptionsFactory.fromArgs(args).withValidation().as(Options.class);
Pipeline pipeline = Pipeline.create(options);
final PCollectionView<Map<Integer, String>> sideInput = pipeline
.apply(CountingInput.forSubrange(0L, 10L))
.apply("Create KV<Integer, String>",ParDo.of(new DoFn<Long, KV<Integer, String>>() {
@ProcessElement
public void processElement(ProcessContext c) { …Run Code Online (Sandbox Code Playgroud)