Skip to content

opt: investigate clean-up of special column handling #51323

@RaduBerinde

Description

@RaduBerinde

Currently, some table columns are special (e.g. write-only, delete-only). These special columns are arranged in a certain way in cat.Table (regular columns first, then writable columns, etc). ColumnCount has multiple variants used to get the boundaries.

This arrangement makes optimizer code error-prone, because special columns can easily be ignored; and it makes adding new types of columns harder (eg #50519).

This issue tracks investigating an alternative where cat.Table has a method ColumnKind(ordinal int) which returns an enum. No assumptions would be made about the order of the columns in the table. This will force all code to check the column kind, rather than implicitly ignoring certain kinds of columns depending on which Count method is used.

Note that putting this method in cat.Column is problematic because currently the implementor of that interface is *ColumnDescriptor where don't have enough information.

Metadata

Metadata

Assignees

Labels

C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions