zhangshenghang opened a new pull request, #11208:
URL: https://github.com/apache/seatunnel/pull/11208

   ### Purpose
   
   Fixes #11008.
   
   MongoDB CDC could throw `DataException: operationType is not a valid field 
name` when a snapshot-style record reached SeaTunnel without an `operationType` 
field in its Kafka Connect schema. Both the deserialization path and the 
snapshot backfill buffer rewrite path read that field directly, so the 
lower-level Kafka Connect exception hid the actual record handling problem.
   
   ### Changes
   
   - Centralized MongoDB CDC operation type extraction in `MongodbRecordUtils`.
   - Treat snapshot records without `operationType` as insert records.
   - Throw a SeaTunnel MongoDB connector exception with clearer context when a 
non-snapshot data record has no operation type.
   - Added a regression test that deserializes a snapshot record whose schema 
does not contain `operationType`.
   
   ### Tests
   
   - `./mvnw spotless:apply`
   - `./mvnw -q -DskipTests verify`
   - `./mvnw -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb 
-Dskip.spotless=true -DskipIT=true 
-Dtest=MongoDBConnectorDeserializationSchemaTest test`


-- 
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