diff --git a/seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/fetch/MongodbFetchTaskContext.java b/seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/fetch/MongodbFetchTaskContext.java index 534baa72abda..d9aee5ef9792 100644 --- a/seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/fetch/MongodbFetchTaskContext.java +++ b/seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/fetch/MongodbFetchTaskContext.java @@ -139,11 +139,11 @@ public boolean isDataChangeRecord(SourceRecord record) { public boolean isRecordBetween( SourceRecord record, @Nonnull Object[] splitStart, @Nonnull Object[] splitEnd) { BsonDocument documentKey = getDocumentKey(record); - BsonDocument splitKeys = (BsonDocument) ((Object[]) splitStart[0])[0]; + BsonDocument splitKeys = (BsonDocument) splitStart[0]; String firstKey = splitKeys.getFirstKey(); BsonValue keyValue = documentKey.get(firstKey); - BsonValue lowerBound = ((BsonDocument) ((Object[]) splitEnd[0])[1]).get(firstKey); - BsonValue upperBound = ((BsonDocument) ((Object[]) splitEnd[0])[1]).get(firstKey); + BsonValue lowerBound = ((BsonDocument) splitStart[1]).get(firstKey); + BsonValue upperBound = ((BsonDocument) splitEnd[1]).get(firstKey); if (isFullRange(lowerBound, upperBound)) { return true;