cockroachdb / cockroachdb/cockroach
schemachanger: add a metadata parameter to declarative schema changer functions
Open
A-schema-changer-impl
C-cleanup
C-enhancement
C-performance
T-sql-foundations
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Currently, schema change implementations within the declarative schema changer take only the `BuildCtx` and the `tree.Statement` specifying the schema change as parameters. This leads to cases like `scbuild.ReferenceProvider`, which re-runs the statement through the optimizer in order to resolve dependencies which were already resolved during the original pass. It also encourages mutation of the original `tree.Statement`. We should add a parameter to the interface of `scbuildstmt.Process` that allows passing arbitrary information from planning into the schema changer.
Jira issue: CRDB-41057
Epic CRDB-60938
Contributor guide
Assessment
This issue has not been assessed yet.