Skip to content

Commit

Permalink
revert change for rowData
Browse files Browse the repository at this point in the history
  • Loading branch information
kiszk committed Dec 20, 2017
1 parent d31ccd7 commit f0163e7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ case class Stack(children: Seq[Expression]) extends Generator {

override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
// Rows - we write these into an array.
val rowData = ctx.freshName("rowsStack")
val rowData = ctx.addMutableState("InternalRow[]", "rows",
v => s"$v = new InternalRow[$numRows];")
val values = children.tail
val dataTypes = values.take(numFields).map(_.dataType)
val code = ctx.splitExpressionsWithCurrentInputs(Seq.tabulate(numRows) { row =>
Expand All @@ -215,7 +216,6 @@ case class Stack(children: Seq[Expression]) extends Generator {
val wrapperClass = classOf[mutable.WrappedArray[_]].getName
ev.copy(code =
s"""
|InternalRow[] $rowData = new InternalRow[$numRows];
|$code
|$wrapperClass<InternalRow> ${ev.value} = $wrapperClass$$.MODULE$$.make($rowData);
""".stripMargin, isNull = "false")
Expand Down

0 comments on commit f0163e7

Please sign in to comment.