twalthr commented on a change in pull request #14174:
URL: https://github.com/apache/flink/pull/14174#discussion_r531133917



##########
File path: 
flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java
##########
@@ -738,15 +739,18 @@ public void reopen(FileInputSplit split, Long state) 
throws IOException {
                Preconditions.checkArgument(state == -1 || state >= 
split.getStart(),
                        " Illegal offset "+ state +", smaller than the splits 
start=" + split.getStart());
 
-               try {
+               // If we checkpointed at the beginning of split simply call open
+               if (split.getStart() == state) {
                        this.open(split);
-               } finally {
-                       this.offset = state;
+                       return;
                }
 
-               if (state > this.splitStart + split.getLength()) {
+               super.open(split);

Review comment:
       In general, I understand the logic. I'm just wondering whether we can 
make the code a bit more maintainable here. Calling `super.open` in `reopen` 
doesn't look right. Maybe we can just introduce a `openInternal()` with a flag 
`doSeek` or something similar. In any case we should add more comments 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to