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

   ## What does this PR do?
   
   Fixes #9866 by including the `key` field when reading MongoDB sharded 
collection metadata.
   
   The splitter later uses that field to build the shard-key row type and chunk 
boundaries. Previously, the query projected `documentKey`, which is unrelated 
to `config.collections.key`, so the valid shard key was discarded and the 
splitter failed with `Document does not contain key 'key'`.
   
   ## Validation
   
   - `./mvnw spotless:apply`
   - `./mvnw -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb 
-Dtest=MongodbUtilsTest test`
   - `./mvnw -q -DskipTests verify`
   
   The added unit test verifies that the metadata query projects the shard key.
   


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