Skip to content

Commit a751838

Browse files
Construct the MutableRow from an existed row
1 parent cb0eae3 commit a751838

File tree

1 file changed

+4
-2
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+4
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Row.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ class GenericRow(protected[sql] val values: Array[Any]) extends Row {
215215
def copy() = this
216216
}
217217

218-
class GenericMutableRow(size: Int) extends GenericRow(size) with MutableRow {
218+
class GenericMutableRow(v: Array[Any]) extends GenericRow(v) with MutableRow {
219219
/** No-arg constructor for serialization. */
220-
def this() = this(0)
220+
def this() = this(null)
221+
222+
def this(size: Int) = this(new Array[Any](size))
221223

222224
override def setBoolean(ordinal: Int, value: Boolean): Unit = { values(ordinal) = value }
223225
override def setByte(ordinal: Int, value: Byte): Unit = { values(ordinal) = value }

0 commit comments

Comments
 (0)