Paul Rogers created DRILL-5531:
----------------------------------
Summary: Nullable value vectors unnecessarily inherit from
BaseDataValueVector
Key: DRILL-5531
URL: https://issues.apache.org/jira/browse/DRILL-5531
Project: Apache Drill
Issue Type: Bug
Affects Versions: 1.8.0
Reporter: Paul Rogers
Priority: Minor
Consider a typical nullable value vector: NullableVarCharVector. The members
are:
{code}
private final UInt1Vector bits = new UInt1Vector(bitsField, allocator);
private final VarCharVector values = new VarCharVector(field, allocator);
{code}
Inheritance is defined as:
{code}
class NullableVarCharVector extends BaseDataValueVector ...
{code}
But, notice the members of {{BaseDataValueVector}}:
{code}
protected DrillBuf data;
{code}
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.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)