[
https://issues.apache.org/jira/browse/BEAM-6241?focusedWorklogId=190640&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-190640
]
ASF GitHub Bot logged work on BEAM-6241:
----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Jan/19 21:43
Start Date: 27/Jan/19 21:43
Worklog Time Spent: 10m
Work Description: iemejia commented on pull request #7293: [BEAM-6241]
Added limit and aggregates support to MongoDbIO
URL: https://github.com/apache/beam/pull/7293#discussion_r251256663
##########
File path:
sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
##########
@@ -426,9 +408,10 @@ private long getEstimatedSizeBytes(
}
LOG.debug("Number of splits is {}", splitKeys.size());
- for (String shardFilter : splitKeysToFilters(splitKeys,
spec.filter())) {
- sources.add(new BoundedMongoDbSource(spec.withFilter(shardFilter)));
- }
+ // TODO: What should be done here?
+ // for (String shardFilter : splitKeysToFilters(splitKeys,
spec.filter())) {
Review comment:
Now that you mention it, there is an open ticket of the connector not
working in atlas, if you are up to check this one and eventually fix it, please
self assign the ticket
[BEAM-4567](https://issues.apache.org/jira/browse/BEAM-4567). It will be a
really welcomed fix, please tell me if you are interested and I will do the
review / help you.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 190640)
Time Spent: 4h 10m (was: 4h)
> 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: 4h 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)