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

Add documentation and improved errors for QueryFn in MongoDbIO

Details

    Description

      Currently the MongoDbIO.Read implementation assumes that the submitted QueryFn is one of the predefined QueryFns in Beam, so either an AggregationQuery or FindQuery. The problem is this assumption is not documented anywhere.

      Fixing this consists of two small changes:

      1. Add documentation to the withQueryFn method specifying that the QueryFn must be one of the predefined classes in the MongoDbIO package.

      2. In the split method, the code checks if the QueryFn is a FindQuery, and if not assumes it's an AggregationQuery, meaning that users that input their own class will find it failing to cast to an AggregationQuery. Instead, there should be an error if the QueryFn is an unknown type, preferably instructing users to only use one of the predefined QueryFn types.

      Attachments

        Activity

          People

            Unassigned Unassigned
            danoliveira Daniel Oliveira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: