[ 
https://issues.apache.org/jira/browse/DRILL-7576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033531#comment-17033531
 ] 

ASF GitHub Bot commented on DRILL-7576:
---------------------------------------

ihuzenko commented on 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]


> Fail fast in operators
> ----------------------
>
>                 Key: DRILL-7576
>                 URL: https://issues.apache.org/jira/browse/DRILL-7576
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.17.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Major
>             Fix For: 1.18.0
>
>
> Continues to the work to clean up operators to "fail fast" by throwing an 
> exception instead of using the more involved STOP status.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to