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

splitKeysToFilter method is creating a bad query string.

Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • 0.3.0-incubating
    • 0.4.0
    • io-java-mongodb

    Description

      When you have a large number of documents in your mongo collection the splitKeysToFilter method is invoked.

      Currently Document{{_id= is prefixed to the query string

      { $and: [ {"_id":{$lte:Objectd("Document{{_id=564a0ad6e21b840001d75f5d}}")}} ]}

      This causes the document parse to fail with the following exception:

      Exception in thread "main" java.lang.IllegalArgumentException: invalid hexadecimal representation of an ObjectId: [Document{{_id=56e1ec546b2f0700015e61b2}}]

      This is caused by line 305

      String splitKey = splitKeys.get(i).toString();
      

      The code should use

      String splitKey = splitKeys.get(i).get("_id").toString();
      

      to just return the ID.

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              davidb1385@gmail.com David Billings
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: