Apache Beam mongodb源

时间:2017-08-11 14:37:45

标签: apache-beam apache-beam-io

我有一个梁管道,它有mongodb作为源,但是当我尝试运行它时会引发异常。

An exception occured while executing the Java class. null: InvocationTargetException: org.apache.beam.sdk.io.BoundedSource.getDefaultOutputCoder()Lorg/apache/beam/sdk/coders/Coder

这是我在main函数

中运行的代码片段
PipelineOptions options = PipelineOptionsFactory.create();

    Pipeline p = Pipeline.create(options);

    p.apply(MongoDbIO.read()
            .withUri("mongodb://<IP address>:27017")
            .withDatabase("<dbname>")
            .withCollection("<collection_name>"));
    p.run().waitUntilFinish();

1 个答案:

答案 0 :(得分:0)

This happened because of different versions of mongo-io plugin and beam plugin