Skip to content

UnionListWriter#startList points the inner writer at the wrong position #585

Closed
@nbauernfeind

Description

@nbauernfeind

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions