Summary
Follow-up to #4364.
CometPlainVector currently uses a growing list of boolean fields to dispatch on vector type:
private final boolean isBaseFixedWidthVector;
// (and now implicitly: offsetBufferAddress != -1 as a sentinel for variable-width)
As noted by @mbutrovich in the PR review, this pattern doesn't scale well. An enum would make the dispatch explicit and extensible.
Proposed change
Introduce a small VectorKind (or similar) enum, e.g.:
private enum VectorKind {
FIXED_WIDTH,
VARIABLE_WIDTH,
// future kinds...
}
private final VectorKind vectorKind;
Replace the boolean flag and the offsetBufferAddress != -1 sentinel with vectorKind checks throughout CometPlainVector.
References
Summary
Follow-up to #4364.
CometPlainVectorcurrently uses a growing list of boolean fields to dispatch on vector type:As noted by @mbutrovich in the PR review, this pattern doesn't scale well. An enum would make the dispatch explicit and extensible.
Proposed change
Introduce a small
VectorKind(or similar) enum, e.g.:Replace the boolean flag and the
offsetBufferAddress != -1sentinel withvectorKindchecks throughoutCometPlainVector.References