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

Nullable value vectors unnecessarily inherit from BaseDataValueVector

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.8.0
    • None
    • None
    • None

    Description

      Consider a typical nullable value vector: NullableVarCharVector. The members are:

        private final UInt1Vector bits = new UInt1Vector(bitsField, allocator);
        private final VarCharVector values = new VarCharVector(field, allocator);
      

      Inheritance is defined as:

      class NullableVarCharVector extends BaseDataValueVector ...
      

      But, notice the members of BaseDataValueVector:

        protected DrillBuf data;
      

      It is confusing that a nullable vector has a data buffer that is never used. Instead, the data is carried by the values member.

      Improvements:

      • Define a new BaseNullableVector class that does not extend BaseDataValueVector.
      • Move the bits member to the new base class rather than declaring it anew in each generated class.
      • Adjust member functions to match.

      Attachments

        Activity

          People

            Unassigned Unassigned
            paul-rogers Paul Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: