[ https://issues.apache.org/jira/browse/BEAM-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15677058#comment-15677058 ]
ASF GitHub Bot commented on BEAM-1006: -------------------------------------- GitHub user david-billings opened a pull request: https://github.com/apache/incubator-beam/pull/1387 [BEAM-1006] Fixing the splitKeysToFilters methofd as calling toString on the Document prefixed …"Document" Be sure to do all of the following to help us incorporate your contribution quickly and easily: - [ ] Make sure the PR title is formatted like: `[BEAM-<Jira issue #>] Description of pull request` - [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable Travis-CI on your fork and ensure the whole test matrix passes). - [ ] Replace `<Jira issue #>` in the title with the actual Jira issue number, if there is one. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt). --- …Document to the string, updated it to just get the value of ID. Also fixed a typo You can merge this pull request into a Git repository by running: $ git pull https://github.com/david-billings/incubator-beam MongoDbIO-filter-fix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-beam/pull/1387.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1387 ---- commit b8fb7c638c47eb9a555b16c84b99b2b4e23466ae Author: DavidB <david.billi...@gandlake.com> Date: 2016-11-18T15:11:47Z Fixing the splitkey, calling to string on the BSON document prefixed Document to the string, updated it to just get the value of ID. Also fixed a typo ---- > splitKeysToFilter method is creating a bad query string. > -------------------------------------------------------- > > Key: BEAM-1006 > URL: https://issues.apache.org/jira/browse/BEAM-1006 > Project: Beam > Issue Type: Bug > Components: sdk-java-extensions > Affects Versions: 0.3.0-incubating > Reporter: David Billings > Assignee: James Malone > Priority: Critical > Labels: mongodb > Fix For: 0.4.0-incubating > > > 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 > {code}{ $and: [ > {"_id":{$lte:Objectd("Document{{_id=564a0ad6e21b840001d75f5d}}")}} ]}{code} > 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 > {code} > String splitKey = splitKeys.get(i).toString(); > {code} > The code should use > {code} > String splitKey = splitKeys.get(i).toString(); > {code} > to just return the ID. -- This message was sent by Atlassian JIRA (v6.3.4#6332)