-
Notifications
You must be signed in to change notification settings - Fork 207
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 to export/full load MongoDB/DocumentDB collection with _id
field of different data type
#4503
Conversation
…d field of different data type Signed-off-by: Dinu John <[email protected]>
Signed-off-by: Dinu John <[email protected]>
Signed-off-by: Dinu John <[email protected]>
// TODO fix eventVersionNumber | ||
final Event event = recordConverter.convert(record, eventCreationTimeMillis, eventCreationTimeMillis, document.getOperationTypeString()); | ||
event.put(DEFAULT_ID_MAPPING_FIELD_NAME, event.get(MONGO_ID_FIELD_NAME, Object.class)); | ||
// event.put(DEFAULT_ID_MAPPING_FIELD_NAME, event.get(DOCUMENTDB_ID_FIELD_NAME, Object.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be configurable in follow up PR. If customer enables the configuration, we will write to customer provided field. Same for export processing.
final long bytes = record.getBytes().length; | ||
bytesReceivedSummary.record(bytes); | ||
// The version number is the export time minus some overlap to ensure new stream events still get priority | ||
final long eventVersionNumber = (exportStartTime - VERSION_OVERLAP_TIME_FOR_EXPORT.toMillis()) * 1_000; | ||
final Event event = recordConverter.convert(record, exportStartTime, eventVersionNumber); | ||
|
||
// event.put(DEFAULT_ID_MAPPING_FIELD_NAME, event.get(DOCUMENTDB_ID_FIELD_NAME, Object.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be configurable in follow up PR. If customer enables the configuration, we will write to customer provided field. Same for stream processing.
switch (streamEventName) { | ||
case "INSERT": | ||
case "MODIFY": | ||
switch (streamEventName.toLowerCase()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix in follow up PR
@@ -376,7 +376,7 @@ void test_processStream_terminateChangeStreamSuccess() { | |||
when(s3PartitionStatus.getPartitions()).thenReturn(partitions); | |||
when(mockPartitionCheckpoint.getGlobalS3FolderCreationStatus(collection)).thenReturn(Optional.of(s3PartitionStatus)); | |||
Event event = mock(Event.class); | |||
when(event.get("_id", Object.class)).thenReturn(UUID.randomUUID().toString()); | |||
//when(event.get("_id", Object.class)).thenReturn(UUID.randomUUID().toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some extra comments in some of these tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will have follow up CR to enable this.
Description
Add support to export/full load MongoDB/DocumentDB collection with
_id
field of different data typeCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.