From 6b20067ce0dda6fb6097e40d7180730c3ab3b780 Mon Sep 17 00:00:00 2001 From: chenzy15 Date: Tue, 1 Aug 2023 20:51:18 +0800 Subject: [PATCH] [Hotfix]Fix array index anomalies caused by #5057 --- .../cdc/mongodb/source/fetch/MongodbFetchTaskContext.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 534baa72abd..d9aee5ef979 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;