Skip to content

Commit

Permalink
optimize array copy
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarvishal09 committed Nov 14, 2018
1 parent ce430dc commit 3e3db52
Showing 1 changed file with 1 addition and 9 deletions.
Expand Up @@ -162,8 +162,6 @@ public static class ColumnVectorProxy extends ColumnVector {

private boolean isLoaded;

private Field byteArray;

public ColumnVectorProxy(ColumnVector columnVector, int capacity, MemoryMode mode) {
super(capacity, columnVector.dataType(), mode);
try {
Expand All @@ -177,8 +175,6 @@ public ColumnVectorProxy(ColumnVector columnVector, int capacity, MemoryMode mod
resultArray.setAccessible(true);
Object o1 = resultArray.get(columnVector);
resultArray.set(this, o1);
byteArray = columnVector.getClass().getDeclaredField("byteData");
byteArray.setAccessible(true);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -458,11 +454,7 @@ public ColumnVector reserveDictionaryIds(int capacity) {
* and offset.
*/
public void putAllByteArray(byte[] data, int offset, int length) {
try {
byteArray.set(vector.arrayData(), data);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
vector.arrayData().appendBytes(length, data, offset);
}

@Override public void close() {
Expand Down

0 comments on commit 3e3db52

Please sign in to comment.