Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-2605

Exception raised when using MongoDBIO.Write in streaming mode

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Duplicate
    • 2.0.0
    • 2.2.0
    • io-java-mongodb
    • None

    Description

      In org.apache.beam.sdk.io.mongodb.MongoDbIO.Write.WriteFn#flush(), no check is done on the size of the batch list of documents before executing the insertMany operation.

      In streaming mode, when processing an empty pane, an empty list of documents can be passed to the MongoDB client which results in the following exception:

      java.lang.IllegalArgumentException: state should be: writes is not an empty list
      at com.mongodb.assertions.Assertions.isTrueArgument(Assertions.java:99)
      at com.mongodb.operation.MixedBulkWriteOperation.<init>(MixedBulkWriteOperation.java:95)
      at com.mongodb.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:323)
      at com.mongodb.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:311)
      at org.apache.beam.sdk.io.mongodb.MongoDbIO$Write$WriteFn.flush(MongoDbIO.java:513)
      at org.apache.beam.sdk.io.mongodb.MongoDbIO$Write$WriteFn.finishBundle(MongoDbIO.java:506)

      Attachments

        Activity

          People

            Unassigned Unassigned
            pcasteran Pascal Castéran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: