drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Rogers (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-5592) BitVector has out-of-date methods from when it was a bit vector
Date Sun, 18 Jun 2017 04:56:00 GMT
Paul Rogers created DRILL-5592:
----------------------------------

             Summary: BitVector has out-of-date methods from when it was a bit vector
                 Key: DRILL-5592
                 URL: https://issues.apache.org/jira/browse/DRILL-5592
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.8.0
            Reporter: Paul Rogers
            Assignee: Paul Rogers
             Fix For: 1.11.0


Drill contains a vector class called {{BitVector}} that, apparently, at one time used bits
to indicate the set (i.e. not null) state of a nullable vector. At some point in time, the
vector because a byte vector (though it retained the original name.)

It seems some methods were never updated and continue to assume 8 values per byte:

{code}
  private int getSizeFromCount(int valueCount) {
    return (int) Math.ceil(valueCount / 8.0);
  }

  @Override
  public int getValueCapacity() {
    return (int) Math.min((long)Integer.MAX_VALUE, data.capacity() * 8L);
  }

  private int getByteIndex(int index) {
    return (int) Math.floor(index / 8.0);
  }
{code}

As a result of this old code, certain other methods don't work as expected:

{code}
  @Override
  public void allocateNew(int valueCount) {
    final int size = getSizeFromCount(valueCount);
    allocateBytes(size);
  }
{code}

The bug causes the above to allocate room for only 1/8 the values expected.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message