diff --git a/flink-doris-connector/src/main/java/org/apache/doris/flink/source/reader/DorisSourceSplitReader.java b/flink-doris-connector/src/main/java/org/apache/doris/flink/source/reader/DorisSourceSplitReader.java index d29dc0db8..ce863377b 100644 --- a/flink-doris-connector/src/main/java/org/apache/doris/flink/source/reader/DorisSourceSplitReader.java +++ b/flink-doris-connector/src/main/java/org/apache/doris/flink/source/reader/DorisSourceSplitReader.java @@ -66,7 +66,7 @@ public RecordsWithSplitIds fetch() throws IOException { } private void checkSplitOrStartNext() throws IOException, DorisException { - if (valueReader != null) { + if (valueReader != null && valueReader.hasNext()) { return; } final DorisSourceSplit nextSplit = splits.poll(); @@ -74,6 +74,7 @@ private void checkSplitOrStartNext() throws IOException, DorisException { throw new IOException("Cannot fetch from another split - no split remaining"); } currentSplitId = nextSplit.splitId(); + LOG.info("currentSplitId {}, split {}", currentSplitId, nextSplit); valueReader = ValueReader.createReader( nextSplit.getPartitionDefinition(), options, readOptions, LOG);