-
Notifications
You must be signed in to change notification settings - Fork 191
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
refactor: make PartitionSpec
more safe
#550
Comments
@liurenjie1024 we just need to be very careful with old PartitionSpecs: They might not be valid anymore for the current schema - yet, we still want to keep them. In think it would be much cleaner to use UnboundPartitionSpecs for these cases. pub struct TableMetadata {
...
pub(crate) partition_specs: HashMap<i32, UnboundPartitionSpecRef>, // Changed to unbound
pub(crate) default_spec: PartitionSpecRef, // This is a new field bound to the current schema.
// Remove: default_spec_id - get it from default_spec.id
} |
This discussion is a follow up of this comment, in summary, I'm thinking about make
PartitionSpec
safe with following changes:schema
field toPartitionSpec
.This will introduce several changes:
PartitionSpec
could only be built using builder, which has checks for serveral parts to ensure it's correctPartitionSpec
's partition type could be infered by itselfTableMetadata
to use builder to build it.The text was updated successfully, but these errors were encountered: