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

This commit is contained in:
tedyu 2016-10-14 10:16:43 -07:00
parent 5f75fa0c4f
commit a68c0e2a34
1 changed files with 5 additions and 1 deletions

View File

@ -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