Repository: spark
Updated Branches:
  refs/heads/branch-1.3 fef2267cd -> 1a8895560


[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 <[email protected]>

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

9300d23 [Cheng Hao] update the SpecificMutableRow.copy

(cherry picked from commit cc552e042896350e21eec9b78593de25006ecc70)
Signed-off-by: Michael Armbrust <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1a889556
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1a889556
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1a889556

Branch: refs/heads/branch-1.3
Commit: 1a8895560f668faed33e99bcb88cafefd64fef03
Parents: fef2267
Author: Cheng Hao <[email protected]>
Authored: Mon Feb 16 12:21:08 2015 -0800
Committer: Michael Armbrust <[email protected]>
Committed: Mon Feb 16 12:21:29 2015 -0800

----------------------------------------------------------------------
 .../spark/sql/catalyst/expressions/SpecificMutableRow.scala   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1a889556/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificMutableRow.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificMutableRow.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificMutableRow.scala
index 7434165..21d714c 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificMutableRow.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificMutableRow.scala
@@ -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 = {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to