From 2db3afd6b5bb8851b8bd938ae66a025c22540cbf Mon Sep 17 00:00:00 2001 From: Roman Kulyk Date: Thu, 20 Jul 2017 16:33:49 +0300 Subject: [PATCH] DRILL-5083: status.getOutcome() return FAILURE if one of the batches has STOP status (to avoid infinite loop in Merge Join). --- .../apache/drill/exec/physical/impl/join/JoinStatus.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java index 8e48515150a..527c9846b75 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -138,7 +138,8 @@ public void setHasMoreData(boolean hasMoreData) { * 4. JoinOutcome.SCHEMA_CHANGED : one of the side has change in schema. */ public JoinOutcome getOutcome() { - if (!ok) { + // on STOP, OUT_OF_MEMORY return FAILURE. + if (!ok || eitherMatches(IterOutcome.STOP)) { return JoinOutcome.FAILURE; } if (hasMoreData) { @@ -162,7 +163,7 @@ public JoinOutcome getOutcome() { return JoinOutcome.WAITING; } ok = false; - // on STOP, OUT_OF_MEMORY return FAILURE. + return JoinOutcome.FAILURE; }