Repository navigation
[flink] Read absent parser paths as NULL in MongoDB specified mode - #11440
Open
LuciferYang wants to merge 2 commits into
Open
LuciferYang wants to merge 2 commits into
LuciferYang wants to merge 2 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
close #11439
In MongoDB CDC
schema.start.mode=specified, every update, replace or delete failed the job withPathNotFoundException. These events build their DELETE record fromdocumentKey, which holds only_id, andJsonPath.readthrows for a configured path that matches nothing.MongoVersionStrategy.parseFieldsFromJsonRecordnow reads an absent path as NULL, the same as an absent field indynamicmode. A field present with a JSON null still becomes"{}", and a malformed path still throwsInvalidPathException.A DELETE built from
documentKeystill has no value for a partition key on another document field, in either mode. The MongoDB CDC page and the--partition_keysoption of both actions now say that such a table keeps the old row of a deleted or moved document. One behavior change: a misspelled path for a non-key field now gives a NULL column instead of failing on the first record.Tests
Mongo4VersionStrategyTest: a delete, an update, and an insert missing a configured field each produce records with the absent column NULL. All three threwPathNotFoundExceptionbefore the fix.MongoDBSyncTableActionITCase#testSpecifiedModeCDCOperations: a specified-mode job applies update, replace and delete events and ends with the expected rows. Before the fix the job failed on the first update and the test reported thePathNotFoundException.