cshuo commented on code in PR #13592:
URL: https://github.com/apache/hudi/pull/13592#discussion_r2224251968


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/StreamReadMonitoringFunction.java:
##########
@@ -213,28 +244,47 @@ public void 
monitorDirAndForwardSplits(SourceContext<MergeOnReadInputSplit> cont
       // table does not exist
       return;
     }
-    IncrementalInputSplits.Result result =
-        incrementalInputSplits.inputSplits(metaClient, this.issuedOffset, 
this.cdcEnabled);
+
+    IncrementalInputSplits.Result result = remainingSplits.isEmpty()
+        ? incrementalInputSplits.inputSplits(metaClient, this.issuedOffset, 
this.cdcEnabled)
+        : IncrementalInputSplits.Result.instance(remainingSplits, 
issuedInstant);
 
     if (result.isEmpty() && StringUtils.isNullOrEmpty(result.getEndInstant())) 
{
       // no new instants, returns early
       LOG.warn("No new instants to read for current run.");
       return;
     }
 
-    for (MergeOnReadInputSplit split : result.getInputSplits()) {
-      context.collect(split);
+    List<MergeOnReadInputSplit> inputSplits = result.getInputSplits();
+    LOG.info("Table {} : Read {} inputsplits for current instant", 
conf.getString(FlinkOptions.TABLE_NAME), inputSplits.size());
+    if (splitsLimit > 0) {

Review Comment:
   Maybe we can set default value of `splitsLimit` as `Integer.MAX_VALUE`, and 
unify the logic here?



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