Skip to content

Commit

Permalink
Reverting hashjoin optimzation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmishra committed Feb 8, 2018
1 parent ad8ff3a commit 45ff68b
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,6 @@ case class HashJoinExec(leftKeys: Seq[Expression],
val produced = streamedPlan.asInstanceOf[CodegenSupport].produce(ctx, this)

val beforeMap = ctx.freshName("beforeMap")
val skipScan = skipProcessForEmptyMap()
val skipCondition = if (skipScan) {
s"if($hashMapTerm.size() == 0) return;"
} else ""

s"""
boolean $keyIsUniqueTerm = true;
Expand All @@ -495,21 +491,13 @@ case class HashJoinExec(leftKeys: Seq[Expression],
final $entryClass[] $mapDataTerm = ($entryClass[])$hashMapTerm.data();
long $numRowsTerm = 0L;
try {
$skipCondition
${session.evaluateFinallyCode(ctx, produced)}
} finally {
$numOutputRows.${metricAdd(numRowsTerm)};
}
"""
}

private def skipProcessForEmptyMap() : Boolean = {
joinType match {
case Inner | LeftSemi => true
case _ => false
}
}

override def doConsume(ctx: CodegenContext, input: Seq[ExprCode],
row: ExprCode): String = {
// variable that holds if relation is unique to optimize iteration
Expand Down

0 comments on commit 45ff68b

Please sign in to comment.