xanderbailey commented on code in PR #3057:
URL: https://github.com/apache/iceberg-rust/pull/3057#discussion_r4518216544
##########
crates/iceberg/src/spec/table_metadata_builder.rs:
##########
@@ -192,6 +193,86 @@ impl TableMetadataBuilder {
)
}
+ /// Replaces the table's schema, partition spec and sort order, leaving it
with no
+ /// current snapshot. Backs `REPLACE TABLE`.
+ ///
+ /// The table keeps its uuid, properties and snapshots, so earlier
snapshots stay readable.
+ /// Columns the table already has keep their field ids, so data written
before the replacement
+ /// stays readable through the columns both schemas share; new columns get
ids above
+ /// `last_column_id`, never a dropped column's id.
+ ///
+ /// Partition fields reuse the highest id an equivalent field has in any
of the table's specs,
+ /// and other fields get ids above `last_partition_id`.
+ ///
+ /// `location` moves the table, `None` leaves it in place. `properties`
are applied on top of
+ /// the existing ones. `format-version` upgrades the table without being
persisted; other
+ /// reserved properties are ignored.
+ ///
+ /// # Errors
+ /// - The table is format version 1, which is not supported.
+ /// - `format-version` is invalid or would downgrade the table.
+ /// - The partition spec or sort order names a column missing from
`schema`.
+ /// - `schema` takes the name of a partition field in one of the table's
specs without being
+ /// that field's source column.
+ pub fn build_replacement(
Review Comment:
[9acd6a4](https://github.com/apache/iceberg-rust/pull/3057/commits/9acd6a4bbd909cda470d103ff1ee6613d4c7f85e)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]