Skip to content
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

Add support for binary _id field in source-mongodb #38103

Merged

Conversation

rodireich
Copy link
Contributor

@rodireich rodireich commented May 9, 2024

What

Source-mongodb can't read collections whose id is a binary. Most commonly used for UUIDs.
This change adds the mongodb Binary type as an acceptable id.

How

ID of binary type will now be parsed correctly and will be saved in state for checkpointing.
Specifically for UUID binary the state will save a human readable value (e.g "D1AF5D9B-377E-4FB7-AE4E-63E875D16C6F") while for all other binaries a base64 encoded value will be saved in state. (e.g enp6enp6enp6eg==).
There is no change in how we convert columns to airbyte records.

Review guide

  1. IdType.java
  2. MongoDbInitialLoadRecordIterator.java
  3. MongoDbStateManager.java

User Impact

Collections whose _id type is binary were previously blocked and can be added now.
All previously allowed collection read should continue to by synced without interruption.

Can this PR be safely reverted and rolled back?

@rodireich rodireich linked an issue May 9, 2024 that may be closed by this pull request
1 task
Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview May 10, 2024 3:48am

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label May 9, 2024
@rodireich rodireich marked this pull request as ready for review May 10, 2024 00:06
@rodireich rodireich requested a review from a team as a code owner May 10, 2024 00:06
@rodireich rodireich requested a review from akashkulk May 10, 2024 00:06
this.converter = converter;
}

public Object convert(final String t) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: dead code removed. not used anywhere other than a test

@rodireich rodireich merged commit 82961ad into master May 10, 2024
35 checks passed
@rodireich rodireich deleted the 36820-source-mongodb-add-support-for-uuid-as-_id-field branch May 10, 2024 17:46
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 connectors/source/mongodb-v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[source-MongoDB] Add support for UUID as _id field
3 participants