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_r376923043
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/StatisticsWriterRecordBatch.java
 ##########
 @@ -91,41 +93,47 @@ public IterOutcome innerNext() {
     }
     // process the complete upstream in one next() call
     IterOutcome upstream;
-    try {
-      do {
-        upstream = next(incoming);
-
-        switch(upstream) {
-          case STOP:
-            return upstream;
-
-          case NOT_YET:
-          case NONE:
-            break;
-
-          case OK_NEW_SCHEMA:
-            setupNewSchema();
-            // $FALL-THROUGH$
-          case OK:
+    do {
+      upstream = next(incoming);
+
+      switch(upstream) {
+        case STOP:
+          return upstream;
+
+        case NOT_YET:
+        case NONE:
+          break;
+
+        case OK_NEW_SCHEMA:
+          setupNewSchema();
+          // $FALL-THROUGH$
+        case OK:
+          try {
             counter += 
statsRecordWriterImpl.writeStatistics(incoming.getRecordCount());
-            logger.debug("Total records written so far: {}", counter);
-
-            for(final VectorWrapper<?> v : incoming) {
-              v.getValueVector().clear();
-            }
-            break;
-
-          default:
-            throw new UnsupportedOperationException();
-        }
-      } while(upstream != IterOutcome.NONE);
-      // Flush blocking writers now
+          } catch (IOException e) {
+            // TODO: Better handled inside the write() method.
 
 Review comment:
   such todos usually live forever in the code, could you please improve the 
```StatisticsRecordWriterImpl.writeStatistics``` in this PR?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to