hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16818 Avoid multiple copies of binary data during the conversion from Result to Row (Weiqing Yang)
Date Fri, 14 Oct 2016 17:16:49 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 5f75fa0c4 -> a68c0e2a3


HBASE-16818 Avoid multiple copies of binary data during the conversion from Result to Row
(Weiqing Yang)


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

Branch: refs/heads/master
Commit: a68c0e2a34186e2f9e8725d7c5b2cb5c88bab148
Parents: 5f75fa0
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Oct 14 10:16:43 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri Oct 14 10:16:43 2016 -0700

----------------------------------------------------------------------
 .../scala/org/apache/hadoop/hbase/spark/DefaultSource.scala    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a68c0e2a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
----------------------------------------------------------------------
diff --git a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
b/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
index 8d94a79..b04abd8 100644
--- a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
+++ b/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
@@ -276,7 +276,11 @@ case class HBaseRelation (
         (x, null)
       } else {
         val v = CellUtil.cloneValue(kv)
-        (x, Utils.hbaseFieldToScalaType(x, v, 0, v.length))
+        (x, x.dt match {
+          // Here, to avoid arraycopy, return v directly instead of calling hbaseFieldToScalaType
+          case BinaryType => v
+          case _ => Utils.hbaseFieldToScalaType(x, v, 0, v.length)
+        })
       }
     }.toMap
     val unionedRow = keySeq ++ valueSeq


Mime
View raw message