File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -308,11 +308,22 @@ impl TableMetadata {
308
308
& self . properties
309
309
}
310
310
311
- /// Normalize this partition spec. This is an internal method
311
+ /// Normalize this partition spec.
312
+ ///
313
+ /// This is an internal method
312
314
/// meant to be called after constructing table metadata from untrusted sources.
313
315
/// We run this method after json deserialization.
314
316
/// All constructors for `TableMetadata` which are part of `iceberg-rust`
315
317
/// should return normalized `TableMetadata`.
318
+ ///
319
+ /// It does:
320
+ /// * Validate the current schema is set and valid
321
+ /// * Validate that all refs are valid (snapshot exists)
322
+ /// * Validate logs are chronological
323
+ /// * Normalize location (remove trailing slash)
324
+ /// * Validate that for V1 Metadata the last_sequence_number is 0
325
+ /// * If the default partition spec is specified but the spec is not present in specs, add it
326
+ /// * If the default sort order is unsorted but the sort order is not present, add it
316
327
pub ( super ) fn try_normalize ( & mut self ) -> Result < & mut Self > {
317
328
self . validate_current_schema ( ) ?;
318
329
self . normalize_current_snapshot ( ) ?;
You can’t perform that action at this time.
0 commit comments