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_r376919500
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScreenCreator.java
 ##########
 @@ -83,47 +83,47 @@ public boolean innerNext() {
       IterOutcome outcome = next(incoming);
       logger.trace("Screen Outcome {}", outcome);
       switch (outcome) {
-      case STOP:
-        return false;
-      case NONE:
-        if (firstBatch) {
-          // this is the only data message sent to the client and may contain 
the schema
-          QueryWritableBatch batch;
-          QueryData header = QueryData.newBuilder()
-            .setQueryId(context.getHandle().getQueryId())
-            .setRowCount(0)
-            .setDef(RecordBatchDef.getDefaultInstance())
-            .build();
-          batch = new QueryWritableBatch(header);
+        case STOP:
+          return false;
+        case NONE:
+          if (firstBatch) {
+            // this is the only data message sent to the client and may 
contain the schema
+            QueryWritableBatch batch;
+            QueryData header = QueryData.newBuilder()
+              .setQueryId(context.getHandle().getQueryId())
+              .setRowCount(0)
+              .setDef(RecordBatchDef.getDefaultInstance())
+              .build();
+            batch = new QueryWritableBatch(header);
+
+            stats.startWait();
+            try {
+              userConnection.sendData(batch);
+            } finally {
+              stats.stopWait();
+            }
+            firstBatch = false; // we don't really need to set this. But who 
knows!
+          }
 
+          return false;
+        case OK_NEW_SCHEMA:
+          materializer = new VectorRecordMaterializer(context, oContext, 
incoming);
+          //$FALL-THROUGH$
+        case OK:
+          injector.injectPause(context.getExecutionControls(), "sending-data", 
logger);
+          final QueryWritableBatch batch = materializer.convertNext();
+          updateStats(batch);
           stats.startWait();
           try {
             userConnection.sendData(batch);
           } finally {
             stats.stopWait();
           }
-          firstBatch = false; // we don't really need to set this. But who 
knows!
-        }
-
-        return false;
-      case OK_NEW_SCHEMA:
-        materializer = new VectorRecordMaterializer(context, oContext, 
incoming);
-        //$FALL-THROUGH$
-      case OK:
-        injector.injectPause(context.getExecutionControls(), "sending-data", 
logger);
-        final QueryWritableBatch batch = materializer.convertNext();
-        updateStats(batch);
-        stats.startWait();
-        try {
-          userConnection.sendData(batch);
-        } finally {
-          stats.stopWait();
-        }
-        firstBatch = false;
-
-        return true;
-      default:
-        throw new UnsupportedOperationException();
+          firstBatch = false;
+
+          return true;
+        default:
+          throw new UnsupportedOperationException();
 
 Review comment:
   Here would be nice to add message containing ```outcome```  which caused the 
exception.

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

Reply via email to