Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ case class SortMergeJoinExec(
keys: Seq[Expression],
input: Seq[Attribute]): Seq[ExprCode] = {
ctx.INPUT_ROW = row
ctx.currentVars = null
keys.map(BindReferences.bindReference(_, input).genCode(ctx))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,13 @@ class DataFrameJoinSuite extends QueryTest with SharedSQLContext {
val ab = a.join(b, Seq("a"), "fullouter")
checkAnswer(ab.join(c, "a"), Row(3, null, 4, 1) :: Nil)
}

test("SPARK-17685: WholeStageCodegenExec throws IndexOutOfBoundsException") {
val df = Seq((1, 1, "1"), (2, 2, "3")).toDF("int", "int2", "str")
val df2 = Seq((1, 1, "1"), (2, 3, "5")).toDF("int", "int2", "str")
val limit = 1310721
val innerJoin = df.limit(limit).join(df2.limit(limit), Seq("int", "int2"), "inner")
.agg(count($"int"))
checkAnswer(innerJoin, Row(1) :: Nil)
}
}