Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Dec 14, 2017
1 parent 103dca3 commit c38f58e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public final ColumnarRow getStruct(int rowId) {
}

/**
* A special version of {@link #getShort(int)}, which is only used as an adapter for Spark codegen
* framework, the second parameter is totally ignored.
* A special version of {@link #getStruct(int)}, which is only used as an adapter for Spark
* codegen framework, the second parameter is totally ignored.
*/
public final ColumnarRow getStruct(int rowId, int size) {
return getStruct(rowId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,26 @@ public WritableColumnVector getDictionaryIds() {
return dictionaryIds;
}

/**
* Update the dictionary.
*/
public void setDictionary(Dictionary dictionary) {
this.dictionary = dictionary;
}

/**
* Reserve a integer column for ids of dictionary.
*/
public WritableColumnVector reserveDictionaryIds(int capacity) {
if (dictionaryIds == null) {
dictionaryIds = reserveNewColumn(capacity, DataTypes.IntegerType);
} else {
dictionaryIds.reset();
dictionaryIds.reserve(capacity);
}
return dictionaryIds;
}

/**
* Ensures that there is enough storage to store capacity elements. That is, the put() APIs
* must work for all rowIds < capacity.
Expand Down Expand Up @@ -646,28 +666,6 @@ public final int appendStruct(boolean isNull) {
*/
protected WritableColumnVector[] childColumns;

/**
* Update the dictionary.
*/
public void setDictionary(Dictionary dictionary) {
this.dictionary = dictionary;
}

/**
* Reserve a integer column for ids of dictionary.
*/
public WritableColumnVector reserveDictionaryIds(int capacity) {
WritableColumnVector dictionaryIds = (WritableColumnVector) this.dictionaryIds;
if (dictionaryIds == null) {
dictionaryIds = reserveNewColumn(capacity, DataTypes.IntegerType);
this.dictionaryIds = dictionaryIds;
} else {
dictionaryIds.reset();
dictionaryIds.reserve(capacity);
}
return dictionaryIds;
}

/**
* Reserve a new column.
*/
Expand Down

0 comments on commit c38f58e

Please sign in to comment.