-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix(mongodb-v2): use max 10k documents while discovering MongoDB schema #8491
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148f917
to
290aaac
Compare
Thanks for the contribution @joelluijmes I requested the team to take a look and review it. |
andriikorotkov
approved these changes
Dec 6, 2021
would love to see this integrated and ready to test it as I have the exact same issue |
\o/ |
1fa2e54
to
94a8a69
Compare
schlattk
pushed a commit
to schlattk/airbyte
that referenced
this pull request
Jan 4, 2022
Co-authored-by: Marcos Marx <marcosmarxm@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/connectors
Connector related issues
area/documentation
Improvements or additions to documentation
community
gl
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Describe what the change is solving
It helps to add screenshots if it affects the frontend.
The mongodb v2 implementation doesn't limit the amount of documents while performing discovery. This PR remedies this behavior. The documentation of the MongoDB states the following:
However, upon testing the integration I noticed it is taking way to long. Digging into the code I never found any references that it is limitted to 10k documents. As my source database has 1.2B documents, it makes sense why discovery taking so long 😓
Further looking around it was already mentioned on a previous PR.
the documentation probably originates from the v1 implementation, where there is an explicit limit.
https://github.com/airbytehq/airbyte/blob/5393070dc6c87c3fccad8b664cee8e30d3e52ba3/airbyte-integrations/connectors/source-mongodb/lib/mongodb_stream.rb
How
Describe the solution
This PR brings the integration in line with the behavior as described on the documentation.
It does so by sampling 10k records at max. Note, the original approach used limit. I'd argue that sample is better approach for discovery.Originally I implemented it with sample, as I thought it worked well. However, with sample of 10k documents, it is very slow. I reverted to the original limit implementation. Now it works :)
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes