Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql/storageparam: break builtins dep on tabledesc #82501

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

ajwerner
Copy link
Contributor

@ajwerner ajwerner commented Jun 7, 2022

The TableStorageParamObserver meant that paramparse and transitively builtins
depended on tabledesc. This was unfortunate because seqexpr is depended
on by builtins and we want to use seqexpr in tabledesc, so we have to make
sure that builtins does not depend on tabledesc.

This commit achieves that goal by splitting out paramparse into three new
packages:

  • sql/storageparam: defines the interface for the Setter, contains functions
    to drive forward the setting and resetting of params, and has some shared
    functionality.
  • sql/storageparam/indexstorageparam: implementation of storageparam.Setter
    for the descpb.IndexDescriptor.
  • sql/storageparam/tablestorageparam: implementation of storageparam.Setter
    for the *tabledesc.Mutable.

This allows the builtins package to use the indexstorageparam package
cleanly without depending on *tabledesc.Mutable. It also recognizes that
lots of utility methods in paramparse aren't about storageparams.

Release note: None

The TableStorageParamObserver meant that paramparse and transitively builtins
depended on tabledesc. This was unfortunate because we want seqexpr is depended
on by builtins and we want to use seqexpr in tabledesc, so we have to make
sure that builtins does not depend on tabledesc.

This commit achieves that goal by splitting out paramparse into three new
packages from paramparse:
 * sql/storageparam: defines the interface for the Setter, contains functions
   to drive forward the setting and resetting of params, and has some shared
   functionality.
 * sql/storageparam/indexstorageparam: implementation of storageparam.Setter
   for the `descpb.IndexDescriptor`.
 * sql/storageparam/tablestorageparam: implementation of storageparam.Setter
   for the `*tabledesc.Mutable`.

This allows the `builtins` package to use the `indexstorageparam` package
cleanly without depending on `*tabledesc.Mutable`. It also recognizes that
lots of utility methods in `paramparse` aren't about `storageparam`s.

Release note: None
@ajwerner ajwerner requested a review from otan June 7, 2022 02:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner ajwerner marked this pull request as ready for review June 7, 2022 02:38
@ajwerner ajwerner requested review from a team June 7, 2022 02:38
@ajwerner
Copy link
Contributor Author

ajwerner commented Jun 7, 2022

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 7, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jun 7, 2022

Build succeeded:

@craig craig bot merged commit 8344e69 into cockroachdb:master Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants