@Override
  public void flatten(boolean selectedInUse, int[] sel, int size) {
    flattenPush();

    if (isRepeating) {
      if (noNulls || !isNull[0]) {
        if (selectedInUse) {
          for (int i = 0; i < size; ++i) {
            int row = sel[i];
            offsets[row] = offsets[0];
            lengths[row] = lengths[0];
            isNull[row] = false;
          }
        } else {
          Arrays.fill(offsets, 0, size, offsets[0]);
          Arrays.fill(lengths, 0, size, lengths[0]);
          Arrays.fill(isNull, 0, size, false);
        }
        // We optimize by assuming that a repeating list/map will run from
        // from 0 .. lengths[0] in the child vector.
        // Sanity check the assumption that we can start at 0.
        if (offsets[0] != 0) {
          throw new IllegalArgumentException("Repeating offset isn't 0, but " +
                                             offsets[0]);
        }
        childFlatten(false, null, (int) lengths[0]);
      } else {
        if (selectedInUse) {
          for(int i=0; i < size; ++i) {
            isNull[sel[i]] = true;
          }
        } else {
          Arrays.fill(isNull, 0, size, true);
        }
      }
      isRepeating = false;
      noNulls = false;
    } else {
      if (selectedInUse) {
        int childSize = 0;
        for(int i=0; i < size; ++i) {
          childSize += lengths[sel[i]];
        }
        int[] childSelection = new int[childSize];
        int idx = 0;
        for(int i=0; i < size; ++i) {
          int row = sel[i];
          for(int elem=0; elem < lengths[row]; ++elem) {
            childSelection[idx++] = (int) (offsets[row] + elem);
          }
        }
        childFlatten(true, childSelection, childSize);
      } else {
        childFlatten(false, null, childCount);
      }
      flattenNoNulls(selectedInUse, sel, size);
    }
  }
Constructor for MultiValuedColumnVector.

@param len Vector length
storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/MultiValuedColumnVector.java