apache / apache/beam

[Feature Request]: Add hint to ReadFromMongoDB, MongoDBIO Connector

Open
#27,426 1 comment 0 reactions 0 assignees View on GitHub
awaiting triage dataflow io new feature P3 python stale
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What would you like to happen?

I am using the MongoDBIO Connector to extract MongoDB data using Google Dataflow. There is a specific collection I have that is very large, and I am using the `filter` option in the connector in order to only get the latest data in each iteration (filtering by the updatedAt attribute).
The current issue is that the calls to extract the data are not very efficient, because my Disk Utilization goes above threshold when performing the operations. I created the index: `{_id: 1, updatedAt: -1}` and that solved the Query Targeting problem, but there are still commands that have an Examined:Returned ratio in the thousands while also having a very high operation execution time (in the hundreds of thousands).
From what I understand, a `hint` can be added to the aggregationPipeline in order to help the queries/commands. This would complement the `filter` option that is currently available.

### Issue Priority

Priority: 3 (nice-to-have improvement)

### Issue Components

- [X] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [X] Component: IO connector
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [X] Component: Google Cloud Dataflow Runner

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.