-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: add catalog.Partitioning interface #64013
Conversation
a9e817f
to
00edda4
Compare
i'm happy to take a look, but may i request these changes be merged after the v21.1 release is finalised (i.e. out as GA)? we may have some backports coming that will not backport nicely when these are in |
Yes absolutely, none of this is urgent. |
00edda4
to
b0511b5
Compare
b0511b5
to
2415fff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 27 of 27 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @postamar)
pkg/ccl/partitionccl/partition.go, line 609 at r1 (raw file):
if part.NumRange() > 0 { log.Fatal(context.TODO(), "TODO(dan): unsupported for range partitionings")
evalCtx.Context
pkg/sql/partition_utils.go, line 242 at r1 (raw file):
} if part.NumRange() > 0 {
nit: should this be called NumRanges()
pkg/sql/catalog/table_elements.go, line 407 at r1 (raw file):
// NumList returns the number of list elements in the underlying partitioning // descriptor. NumList() int
nit: NumLists() ?
2415fff
to
696e9e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @otan)
pkg/ccl/partitionccl/partition.go, line 609 at r1 (raw file):
Previously, otan (Oliver Tan) wrote…
evalCtx.Context
Done.
pkg/sql/partition_utils.go, line 242 at r1 (raw file):
Previously, otan (Oliver Tan) wrote…
nit: should this be called NumRanges()
Done.
pkg/sql/catalog/table_elements.go, line 407 at r1 (raw file):
Previously, otan (Oliver Tan) wrote…
nit: NumLists() ?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 12 of 12 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @otan)
This commit aims at reducing direct usage of descpb.PartitioningDescriptor types and instead using the new catalog.Partitioning interface. This refactoring is in line with recent virtualization work tracked under cockroachdb#56306. In an effort to improve readability and ability to reason about state changes, this commit changes the type signature of sql.CreatePartitioning and, notably, removes its side-effects on the index descriptor. The latter is now modified using a new tabledesc.UpdateIndexPartitioning function. Release note: None
696e9e4
to
a24d6c2
Compare
Rebased on fresh master. |
bors r+ |
Build succeeded: |
This commit aims at reducing direct usage of
descpb.PartitioningDescriptor types and instead using the new
catalog.Partitioning interface. This refactoring is in line with recent
virtualization work tracked under #56306.
In an effort to improve readability and ability to reason about state
changes, this commit changes the type signature of sql.CreatePartitioning
and, notably, removes its side-effects on the index descriptor. The
latter is now modified using a new tabledesc.UpdateIndexPartitioning
function.
Release note: None