Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into codegen
  • Loading branch information
cloud-fan committed Dec 21, 2017
commit 95d0c1b5c3473509d617675c58f0006e28ed58c1
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ case class Stack(children: Seq[Expression]) extends Generator {
// Rows - we write these into an array.
val rowData = ctx.addMutableState("InternalRow[]", "rows",
v => s"$v = new InternalRow[$numRows];")
// Create the collection.
val wrapperClass = classOf[mutable.WrappedArray[_]].getName
ev.value = ctx.addMutableState(s"$wrapperClass<InternalRow>", ev.value,
v => s"$v = $wrapperClass$$.MODULE$$.make($rowData);")

val values = children.tail
val dataTypes = values.take(numFields).map(_.dataType)
val code = ctx.splitExpressionsWithCurrentInputs(Seq.tabulate(numRows) { row =>
Expand All @@ -217,7 +212,13 @@ case class Stack(children: Seq[Expression]) extends Generator {
s"${eval.code}\n$rowData[$row] = ${eval.value};"
})

ev.copy(code = code, isNull = "false")
// Create the collection.
val wrapperClass = classOf[mutable.WrappedArray[_]].getName
ev.copy(code =
s"""
|$code
|$wrapperClass<InternalRow> ${ev.value} = $wrapperClass$$.MODULE$$.make($rowData);
""".stripMargin, isNull = "false")
}
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.