Skip to content

Refactor CometPlainVector by replacing boolean flags with an enum #4433

@0lai0

Description

@0lai0

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions