JingsongLi commented on a change in pull request #17792:
URL: https://github.com/apache/flink/pull/17792#discussion_r752127462



##########
File path: 
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/filesystem/LimitableBulkFormat.java
##########
@@ -105,8 +111,16 @@ private boolean reachLimit() {
                 return null;
             }
 
-            RecordIterator<T> batch = reader.readBatch();
-            return batch == null ? null : new LimitableIterator(batch);
+            try {
+                RecordIterator<T> batch = reader.readBatch();
+                return batch == null ? null : new LimitableIterator(batch);
+            } catch (Exception e) {

Review comment:
       First,
   - The `synchronized` is for the creation of the counter.
   - The counter is for the limit number.
   They are for different purposes.
   
   LIMIT N would produce a list of N records totally. But the source can 
produce more. There are limiters in the downstream operator.
   So the `globalNumberRead` is just for the total limit, as soon as someone 
has reached its limit, the source can be ended.




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to