Skip to content

sql/catalog: clean up the descs.Collection resolution-by-ID methods #57539

@thoszhang

Description

@thoszhang

Currently descs.Collection has many methods for descriptor resolution by ID (for each descriptor type and for mutable vs. immutable, as well as GetMutableDescriptorByID for any descriptor type). These are backed by two different implementations for mutable vs. immutable descriptors which are somewhat divergent in their handling of uncommitted descriptors, non-public states, etc.

These implementations should be merged, and we should probably merge the interfaces as well. We could have a single method GetDescriptorByID, but that poses problems for catalog.ResolvedSchema. Maybe we'd have to do #57538 first. Another idea is to have GetMutableDescriptorByID (which evidently has some use now) and GetImmutableDescriptorByID, or something.

Part of the work here is just investigating what the current behavior is for non-public descriptors (and other less common cases) is. We're inconsistent about resolution for tables in the adding state, in particular.

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