Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5602

Repeated List Vector fails to initialize the offset vector

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.12.0
    • Component/s: None
    • Labels:
      None

      Description

      The code that allocates a new RepeatedListVector does not initialize the first offset to zero as required:

        @Override
        public void allocateNew(int valueCount, int innerValueCount) {
          clear();
          getOffsetVector().allocateNew(valueCount + 1);
          getMutator().reset();
        }
      

      Since Netty does not zero-fill vectors, the result is vector corruption.

      If the code worked correctly, here is the behavior when writing to the first element of the list:

      • Access the offset vector at offset 0. Should be 0.
      • Write the new value at that offset. Since the first offset is 0, the first value is written at 0 in the value vector.
      • Write into offset 1 the value at offset 0 plus the length of the new value.

      But, the offset vector is not initialized to zero. Instead, offset 0 contains the value 16 million. Now:

      • Access the offset vector at offset 0. Value is 16 million.
      • Write the new value at that offset. Write at position 16 million. This requires growing the value vector from its present size to 16 MB.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paul-rogers Paul Rogers
                Reporter:
                paul-rogers Paul Rogers
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: