UnionListWriter's impl:
@Override
public void startList() {
vector.startNewValue(idx());
writer.setPosition(vector.getOffsetBuffer().getInt((idx() + 1L) * OFFSET_WIDTH));
listStarted = true;
}
Whereas UnionLargeListViewWriter:
@Override
public void startList() {
vector.startNewValue(idx());
writer.setPosition(vector.getOffsetBuffer().getInt((idx()) * OFFSET_WIDTH));
listStarted = true;
}
Note that the issue is that UnionListWriter fetches the offset of idx() + 1 -- not the offset of idx() like the Large impl.
Also note that startNewValue returns the position that the writer can be set to; we don't need to poke into the offset buffer.