Skip to content
Snippets Groups Projects
Commit cc552e04 authored by Cheng Hao's avatar Cheng Hao Committed by Michael Armbrust
Browse files

[SQL] [Minor] Update the SpecificMutableRow.copy

When profiling the Join / Aggregate queries via VisualVM, I noticed lots of `SpecificMutableRow` objects created, as well as the `MutableValue`, since the `SpecificMutableRow` are mostly used in data source implementation, but the `copy` method could be called multiple times in upper modules (e.g. in Join / aggregation etc.), duplicated instances created should be avoid.

Author: Cheng Hao <hao.cheng@intel.com>

Closes #4619 from chenghao-intel/specific_mutable_row and squashes the following commits:

9300d23 [Cheng Hao] update the SpecificMutableRow.copy
parent 8e25373c
No related branches found
No related tags found
No related merge requests found
......@@ -220,13 +220,14 @@ final class SpecificMutableRow(val values: Array[MutableValue]) extends MutableR
override def isNullAt(i: Int): Boolean = values(i).isNull
override def copy(): Row = {
val newValues = new Array[MutableValue](values.length)
val newValues = new Array[Any](values.length)
var i = 0
while (i < values.length) {
newValues(i) = values(i).copy()
newValues(i) = values(i).boxed
i += 1
}
new SpecificMutableRow(newValues)
new GenericRow(newValues)
}
override def update(ordinal: Int, value: Any): Unit = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment