Repository: incubator-beam
Updated Branches:
  refs/heads/master aeff1d5c2 -> 3f16f2660


[BEAM-1006] Fixing the MongoDbIO splitKeysToFilters, calling to string on the 
BSON document prefixed Document to the string, updated it to just get the value 
of ID


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/b453457f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/b453457f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/b453457f

Branch: refs/heads/master
Commit: b453457f5699963f9a72129ab86ef18b71c04e61
Parents: aeff1d5
Author: DavidB <[email protected]>
Authored: Fri Nov 18 15:11:47 2016 +0000
Committer: Jean-Baptiste Onofré <[email protected]>
Committed: Tue Nov 29 07:50:40 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/b453457f/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
----------------------------------------------------------------------
diff --git 
a/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
 
b/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
index cd5cdaf..70239e6 100644
--- 
a/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
+++ 
b/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
@@ -302,12 +302,12 @@ public class MongoDbIO {
       ArrayList<String> filters = new ArrayList<>();
       String lowestBound = null; // lower boundary (previous split in the 
iteration)
       for (int i = 0; i < splitKeys.size(); i++) {
-        String splitKey = splitKeys.get(i).toString();
-        String rangeFilter = null;
+        String splitKey = splitKeys.get(i).get("_id").toString();
+        String rangeFilter;
         if (i == 0) {
           // this is the first split in the list, the filter defines
           // the range from the beginning up to this split
-          rangeFilter = String.format("{ $and: [ 
{\"_id\":{$lte:Objectd(\"%s\")}}",
+          rangeFilter = String.format("{ $and: [ 
{\"_id\":{$lte:ObjectId(\"%s\")}}",
               splitKey);
         } else if (i == splitKeys.size() - 1) {
           // this is the last split in the list, the filter defines

Reply via email to