ihuzenko commented on a change in pull request #1975: DRILL-7576: Fail fast for
operator errors
URL: https://github.com/apache/drill/pull/1975#discussion_r376912149
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java
##########
@@ -212,13 +213,24 @@ private boolean shouldContinueAfterNoRecords() throws
Exception {
}
return true;
} else { // Regular scan
- currentReader.close();
- currentReader = null;
+ closeCurrentReader();
return true; // In regular case, we always continue the iteration, if no
more reader, we will break out at the head of loop
}
}
- private IterOutcome internalNext() throws Exception {
+ private void closeCurrentReader() {
+ try {
+ if (currentReader != null) {
Review comment:
I would suggest putting whole ```try-catch-finally``` inside the if, or
using our ```Autocloseables``` like:
```java
AutoCloseables.closeSilently(currentReader);
currentReader = null;
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services