Skip to content

Commit

Permalink
Revert "fix: don't create new metadata struct"
Browse files Browse the repository at this point in the history
This reverts commit 1f6cd6f.
  • Loading branch information
rtyler authored and ion-elgreco committed Oct 7, 2024
1 parent 1d235d7 commit 87f2707
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/core/src/operations/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ impl std::future::IntoFuture for WriteBuilder {
if let Some(snapshot) = &this.snapshot {
let schema_struct: StructType = schema.clone().try_into()?;
let current_protocol = snapshot.protocol();
let mut metadata = snapshot.metadata().clone();
let configuration = snapshot.metadata().configuration.clone();
let maybe_new_protocol = if PROTOCOL
.contains_timestampntz(schema_struct.fields())
&& !current_protocol
Expand All @@ -965,18 +965,19 @@ impl std::future::IntoFuture for WriteBuilder {
if !(current_protocol.min_reader_version == 3
&& current_protocol.min_writer_version == 7)
{
Some(new_protocol.move_table_properties_into_features(
&metadata.configuration.clone(),
))
Some(new_protocol.move_table_properties_into_features(&configuration))
} else {
Some(new_protocol)
}
} else {
None
};
metadata.schema_string = serde_json::to_string(&schema_struct)?;
metadata.partition_columns = partition_columns.clone();
actions.push(metadata.into());
let schema_action = Action::Metadata(Metadata::try_new(
schema_struct,
partition_columns.clone(),
configuration,
)?);
actions.push(schema_action);
if let Some(new_protocol) = maybe_new_protocol {
actions.push(new_protocol.into())
}
Expand Down

0 comments on commit 87f2707

Please sign in to comment.