Skip to content

Commit

Permalink
Move initializing child columns into constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
ueshin committed Aug 22, 2017
1 parent ccb2d59 commit 5782cc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[]
public OffHeapColumnVector(int capacity, DataType type) {
super(capacity, type);

initialize();

nulls = 0;
data = 0;
lengthData = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static OnHeapColumnVector[] allocateColumns(int capacity, StructField[] f

public OnHeapColumnVector(int capacity, DataType type) {
super(capacity, type);
initialize();

reserveInternal(capacity);
reset();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,12 @@ public WritableColumnVector getDictionaryIds() {
protected abstract WritableColumnVector reserveNewColumn(int capacity, DataType type);

/**
* Initialize child columns.
* Sets up the common state and also handles creating the child columns if this is a nested
* type.
*/
protected void initialize() {
protected WritableColumnVector(int capacity, DataType type) {
super(capacity, type);

if (type instanceof ArrayType || type instanceof BinaryType || type instanceof StringType
|| DecimalType.isByteArrayDecimalType(type)) {
DataType childType;
Expand Down Expand Up @@ -645,12 +648,4 @@ protected void initialize() {
this.resultStruct = null;
}
}

/**
* Sets up the common state and also handles creating the child columns if this is a nested
* type.
*/
protected WritableColumnVector(int capacity, DataType type) {
super(capacity, type);
}
}

0 comments on commit 5782cc4

Please sign in to comment.