-
Notifications
You must be signed in to change notification settings - Fork 49
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
add a new TableConfiguration
struct to bundle protocol/metadata cross-validation
#571
Comments
also devil's advocate from @nicklan: do we need this? Or should it all just be in |
I believe we discussed that at some point, and we realized that transactions (which eventually will need to update this sort of info) would also need a |
proposal: // old Snapshot
pub struct Snapshot {
pub(crate) table_root: Url,
pub(crate) log_segment: LogSegment,
metadata: Metadata,
protocol: Protocol,
schema: Schema,
table_properties: TableProperties,
pub(crate) column_mapping_mode: ColumnMappingMode,
}
// new Snapshot
pub struct Snapshot {
pub(crate) table_root: Url,
pub(crate) log_segment: LogSegment,
pub(crate) table_config: TableConfiguration
}
// new (pub?) TableConfiguration to wrap up all the 'configuration' of a table and perform all
// the cross-validation between e.g. Protocol and Metadata (table properties) etc.
pub struct TableConfiguration {
metadata: Metadata,
protocol: Protocol,
schema: Schema,
table_properties: TableProperties,
column_mapping_mode: ColumnMappingMode, // remove and just compute on-the-fly?
}
// expose a bunch of useful methods to get col mapping mode, DV enablement, etc.
// these have to check both protocol and metadata thus having them all bundled is useful
impl TableConfiguration {
fn table_properties() -> &TableProperties // etc. to get pieces (or just pub(crate) fields?)
fn column_mapping_mode() -> ColumnMappingMode { ... }
... // more methods to check DV, table features, enablement, etc.
} |
I like the proposal 👍 I think One thing to note for CDF tho is that we need to be able to incrementally update TableConfiguration with a new Protocol or a new Metadata. This is because a commit could only update Metadata, and have no Protocol actions. This should be easy to pass the data into a newly constructed TableConfiguration, but I just wanted to point that out. |
Yea nice thanks - I think this underscores the idea the And yea you would do |
Yep! Tho I think we'll need to be able to construct a new one with the old metadata. Ex: let (Some(protocol), None) = (commit.protocol, commit.metadata) {
table_config = table_config.with_protocol(protocol)
} or let (Some(protocol), None) = (commit.protocol, commit.metadata) {
let metadata = table_config.metadata();
table_config = TableConfig::try_new(protocol, metadata)
} |
interesting. yea sounds like a case for having that sort of modular API to update a |
include (1) schema, (2) protocol, (3) table properties. expose high-level APIs for checking table feature status etc.
The text was updated successfully, but these errors were encountered: