MonsterChenzhuo commented on code in PR #1740:
URL: https://github.com/apache/incubator-paimon/pull/1740#discussion_r1285493841


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/source/align/AlignedContinuousFileSplitEnumerator.java:
##########
@@ -220,7 +221,7 @@ protected void 
processDiscoveredSplits(PlanWithNextSnapshotId ignore, Throwable
         if (nextPlan != null) {
             nextSnapshotId = nextPlan.nextSnapshotId();
             TableScan.Plan plan = nextPlan.plan();
-            if (plan.splits().isEmpty()) {
+            if (plan.splits().isEmpty() && nextSnapshotId != null) {

Review Comment:
   <img width="851" alt="图片" 
src="https://github.com/apache/incubator-paimon/assets/60029759/fa9796ae-f782-4cc0-94b6-7e28155ba75b";>
   I noticed that the constructor defines nextSnapshotId as nullable. I'm not 
sure whether the else logic, specifically 
addSplits(splitGenerator.createSplits(plan));, will be triggered when 
nextSnapshotId is null. Since I'm not very familiar with the code logic, I am 
uncertain about the best approach.
   
   `
   1:
   if (nextPlan != null) {
               nextSnapshotId = nextPlan.nextSnapshotId();
               Objects.requireNonNull(nextSnapshotId);
               TableScan.Plan plan = nextPlan.plan();
               if (plan.splits().isEmpty()) {
                   addSplits(
                           Collections.singletonList(
                                   new FileStoreSourceSplit(
                                           PLACEHOLDER_SPLIT,
                                           new PlaceholderSplit(nextSnapshotId 
- 1))));
               } else {
                   addSplits(splitGenerator.createSplits(plan));
               }
           }
   2:
     if (nextPlan != null) {
         nextSnapshotId = nextPlan.nextSnapshotId();
         TableScan.Plan plan = nextPlan.plan();
         if (plan.splits().isEmpty()) {
             Objects.requireNonNull(nextSnapshotId);
             addSplits(
                     Collections.singletonList(
                             new FileStoreSourceSplit(
                                     PLACEHOLDER_SPLIT,
                                     new PlaceholderSplit(nextSnapshotId - 
1))));
         } else {
             addSplits(splitGenerator.createSplits(plan));
         }
     }
   
   
   `



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