Skip to content

Commit

Permalink
add setTypeId to sparse UnionVector
Browse files Browse the repository at this point in the history
  • Loading branch information
jarohen authored and FiV0 committed May 21, 2024
1 parent d45468e commit 8573abb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion java/vector/src/main/codegen/templates/UnionVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,14 @@ public void setSafe(int index, Nullable${name}Holder holder) {
</#list>
public void setType(int index, MinorType type) {
setTypeId(index, (byte) type.ordinal());
}
public void setTypeId(int index, byte typeId) {
while (index >= getTypeBufferValueCapacity()) {
reallocTypeBuffer();
}
typeBuffer.setByte(index * TYPE_WIDTH , (byte) type.ordinal());
typeBuffer.setByte(index * TYPE_WIDTH , typeId);
}
private int getTypeBufferValueCapacity() {
Expand Down

0 comments on commit 8573abb

Please sign in to comment.