ihuzenko commented on a change in pull request #1981: DRILL-7583: Remove STOP
status from operator outcome
URL: https://github.com/apache/drill/pull/1981#discussion_r379447867
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
##########
@@ -679,67 +715,91 @@ public IterOutcome innerNext() {
}
/**
- * In case an upstream data is no longer needed, send a kill and flush any
remaining batch
+ * In case an upstream data is no longer needed, send a kill and flush any
+ * remaining batch
*
- * @param batch probe or build batch
- * @param upstream which upstream
- * @param isLeft is it the left or right
+ * @param batch
+ * probe or build batch
+ * @param upstream
+ * which upstream
+ * @param isLeft
+ * is it the left or right
*/
- private void killAndDrainUpstream(RecordBatch batch, IterOutcome upstream,
boolean isLeft) {
- batch.kill(true);
- while (upstream == IterOutcome.OK_NEW_SCHEMA || upstream ==
IterOutcome.OK) {
+ private void killAndDrainUpstream(RecordBatch batch, IterOutcome upstream,
+ boolean isLeft) {
+ batch.cancel();
+ while (upstream == IterOutcome.OK_NEW_SCHEMA
+ || upstream == IterOutcome.OK) {
VectorAccessibleUtilities.clear(batch);
- upstream = next( isLeft ? HashJoinHelper.LEFT_INPUT :
HashJoinHelper.RIGHT_INPUT, batch);
+ upstream = next(
+ isLeft ? HashJoinHelper.LEFT_INPUT : HashJoinHelper.RIGHT_INPUT,
+ batch);
}
}
- private void killAndDrainLeftUpstream() { killAndDrainUpstream(probeBatch,
leftUpstream, true); }
- private void killAndDrainRightUpstream() { killAndDrainUpstream(buildBatch,
rightUpstream, false); }
+ private void killAndDrainLeftUpstream() {
+ killAndDrainUpstream(probeBatch, leftUpstream, true);
+ }
+
+ private void killAndDrainRightUpstream() {
+ killAndDrainUpstream(buildBatch, rightUpstream, false);
+ }
private void setupHashTable() {
- List<Comparator> comparators =
Lists.newArrayListWithExpectedSize(conditions.size());
-
conditions.forEach(cond->comparators.add(JoinUtils.checkAndReturnSupportedJoinComparator(cond)));
+ List<Comparator> comparators = Lists
+ .newArrayListWithExpectedSize(conditions.size());
+ conditions.forEach(cond -> comparators
+ .add(JoinUtils.checkAndReturnSupportedJoinComparator(cond)));
Review comment:
makes sense to collect comparators right before HashTableConfig(...)
constructor call, using :
```java
List<Comparator> comparators = conditions.stream()
.map(JoinUtils::checkAndReturnSupportedJoinComparator)
.collect(Collectors.toList());
```
----------------------------------------------------------------
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