[ https://issues.apache.org/jira/browse/BEAM-6241?focusedWorklogId=193390&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-193390 ]
ASF GitHub Bot logged work on BEAM-6241: ---------------------------------------- Author: ASF GitHub Bot Created on: 01/Feb/19 14:42 Start Date: 01/Feb/19 14:42 Worklog Time Spent: 10m Work Description: iemejia commented on issue #7293: [BEAM-6241] Added limit and aggregates support to MongoDbIO URL: https://github.com/apache/beam/pull/7293#issuecomment-459744437 Thanks @sandboxws. Now we are going to do a reverse review :) Can you please take a look at this commit and give me your feedback https://github.com/iemejia/beam/commit/f2d92f26039ebe73e6e7ef26a2c258de515200f1 I changed the builders to use `AutoValue` to be more consistent with Beam practices. I renamed `QueryBuilder` to `QueryFn` but I am even hesitating to call it just `Query`. I also did some minor fixes on some basic things that static analysis tools complained about like constrained access levels. Most important subject now we need to address is partitioning (aka splitting). I am keeping the partitioning approach we had and do the filtering per each shard if it is a FindQuery. I assume that this is correct. Do you see any possible issue? The question I still have is what happens with Aggregates? Are they partitionable? Because if I take the same approach of aggregate per shard the user will have incorrect results. Do you know how it works? We are really close! My idea is once we agree on these last points to reopen a PR with both commits and get it re-reviewed and merged. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 193390) Time Spent: 5h 10m (was: 5h) > MongoDbIO - Add Limit and Aggregates Support > -------------------------------------------- > > Key: BEAM-6241 > URL: https://issues.apache.org/jira/browse/BEAM-6241 > Project: Beam > Issue Type: Improvement > Components: io-java-mongodb > Affects Versions: 2.9.0 > Reporter: Ahmed El.Hussaini > Assignee: Ahmed El.Hussaini > Priority: Major > Labels: easyfix > Time Spent: 5h 10m > Remaining Estimate: 0h > > h2. Adds Support to Limit Results > > {code:java} > MongoDbIO.read() > .withUri("mongodb://localhost:" + port) > .withDatabase(DATABASE) > .withCollection(COLLECTION) > .withFilter("{\"scientist\":\"Einstein\"}") > .withLimit(5));{code} > h2. Adds Support to Use Aggregates > > {code:java} > List<BsonDocument> aggregates = new ArrayList<BsonDocument>(); > aggregates.add( > new BsonDocument( > "$match", > new BsonDocument("country", new BsonDocument("$eq", new > BsonString("England"))))); > PCollection<Document> output = > pipeline.apply( > MongoDbIO.read() > .withUri("mongodb://localhost:" + port) > .withDatabase(DATABASE) > .withCollection(COLLECTION) > .withAggregate(aggregates)); > {code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)