Skip to content

Commit

Permalink
Avoid creating String in getUTF8String.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jun 23, 2016
1 parent 855bcfd commit 66ab632
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,11 @@ public Decimal getDecimal(int ordinal, int precision, int scale) {
@Override
public UTF8String getUTF8String(int ordinal) {
BytesColumnVector bv = ((BytesColumnVector)columns[columnIDs.get(ordinal)]);
String str = null;
if (bv.isRepeating) {
str = new String(bv.vector[0], bv.start[0], bv.length[0], StandardCharsets.UTF_8);
return UTF8String.fromBytes(bv.vector[0], bv.start[0], bv.length[0]);
} else {
str = new String(bv.vector[rowId], bv.start[rowId], bv.length[rowId],
StandardCharsets.UTF_8);
return UTF8String.fromBytes(bv.vector[rowId], bv.start[rowId], bv.length[rowId]);
}
return UTF8String.fromString(str);
}

@Override
Expand Down

0 comments on commit 66ab632

Please sign in to comment.