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

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

paul-rogers commented on pull request #1981: DRILL-7583: Remove STOP status 
from operator outcome
URL: https://github.com/apache/drill/pull/1981#discussion_r379848926
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
 ##########
 @@ -479,34 +493,41 @@ private IterOutcome sniffNonEmptyBatch(IterOutcome curr, 
int inputIndex, RecordB
       curr = next(inputIndex, recordBatch);
 
       switch (curr) {
-        case OK:
-          // We got a data batch
-          break;
-        case NOT_YET:
-          // We need to try again
-          break;
-        case EMIT:
-          throw new UnsupportedOperationException("We do not support " + EMIT);
-        default:
-          // Other cases are termination conditions
-          return curr;
+      case OK:
+        // We got a data batch
+        break;
+      case NOT_YET:
+        // We need to try again
+        break;
+      case EMIT:
+        throw new UnsupportedOperationException("We do not support " + EMIT);
+      default:
+        // Other cases are termination conditions
+        return curr;
       }
     }
   }
 
   /**
-   * Determines the memory calculator to use. If maxNumBatches is configured 
simple batch counting is used to spill. Otherwise
-   * memory calculations are used to determine when to spill.
+   * Determines the memory calculator to use. If maxNumBatches is configured
+   * simple batch counting is used to spill. Otherwise memory calculations are
+   * used to determine when to spill.
+   *
    * @return The memory calculator to use.
    */
   public HashJoinMemoryCalculator getCalculatorImpl() {
     if (maxBatchesInMemory == 0) {
-      double safetyFactor = 
context.getOptions().getDouble(ExecConstants.HASHJOIN_SAFETY_FACTOR_KEY);
-      double fragmentationFactor = 
context.getOptions().getDouble(ExecConstants.HASHJOIN_FRAGMENTATION_FACTOR_KEY);
-      double hashTableDoublingFactor = 
context.getOptions().getDouble(ExecConstants.HASHJOIN_HASH_DOUBLE_FACTOR_KEY);
-      String hashTableCalculatorType = 
context.getOptions().getString(ExecConstants.HASHJOIN_HASHTABLE_CALC_TYPE_KEY);
-
-      return new HashJoinMemoryCalculatorImpl(safetyFactor, 
fragmentationFactor, hashTableDoublingFactor, hashTableCalculatorType, 
semiJoin);
+      double safetyFactor = context.getOptions()
+          .getDouble(ExecConstants.HASHJOIN_SAFETY_FACTOR_KEY);
+      double fragmentationFactor = context.getOptions()
+          .getDouble(ExecConstants.HASHJOIN_FRAGMENTATION_FACTOR_KEY);
+      double hashTableDoublingFactor = context.getOptions()
+          .getDouble(ExecConstants.HASHJOIN_HASH_DOUBLE_FACTOR_KEY);
+      String hashTableCalculatorType = context.getOptions()
+          .getString(ExecConstants.HASHJOIN_HASHTABLE_CALC_TYPE_KEY);
+
+      return new HashJoinMemoryCalculatorImpl(safetyFactor, 
fragmentationFactor,
+          hashTableDoublingFactor, hashTableCalculatorType, semiJoin);
 
 Review comment:
   Another good suggestion. After this PR is in, do you want to take a crack at 
fixing some of this stuff?
 
----------------------------------------------------------------
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]


> Remove STOP status in favor of fail-fast
> ----------------------------------------
>
>                 Key: DRILL-7583
>                 URL: https://issues.apache.org/jira/browse/DRILL-7583
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.17.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Major
>             Fix For: 1.18.0
>
>
> The original error solution was a complex process of a) setting a failed 
> flag, b) telling all upstream operators they have failed, c) returning a 
> {{STOP}} status.  Drill has long supported a "fail-fast" error path based on 
> throwing an exception; relying on the fragment executor to clean up the 
> operator stack. Recent revisions have converted most operators to use the 
> simpler fail-fast strategy based on throwing an exception instead of using 
> the older {{STOP}} approach. This change simply removes the old, now-unused 
> {{STOP}} based path.



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

Reply via email to