LuciferYang opened a new issue, #11439:
URL: https://github.com/apache/paimon/issues/11439

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   ### Paimon version
   
   master (4dc01acdb5)
   
   ### Compute Engine
   
   Flink, `mongodb_sync_table` / `mongodb_sync_database`
   
   ### Minimal reproduce step
   
   1. Start `mongodb_sync_table` with `--mongodb_conf 
schema.start.mode=specified`, `field.name=_id,name,description` and 
`parser.path=$._id,$.name,$.description`, as in the "specified field mapping" 
example of the MongoDB CDC docs.
   2. After the snapshot rows arrive, update, replace or delete a document in 
the collection.
   
   ### What doesn't meet your expectations?
   
   The job fails on the first update, replace or delete:
   
   ```
   com.jayway.jsonpath.PathNotFoundException: No results for path: $['name']
   ```
   
   A delete, and the DELETE half of an update or replace, is built from the 
event's `documentKey`, which holds only `_id`. 
`MongoVersionStrategy.parseFieldsFromJsonRecord` reads every configured path 
with `JsonPath.read`, which throws for a definite path that matches nothing. An 
insert of a document without one of the configured fields fails the same way.
   
   Expected: an absent path reads as NULL, as an absent field does in the 
default `dynamic` mode.
   
   ### Anything else?
   
   The existing specified-mode IT only checks snapshot inserts, so nothing 
covered this.
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to