Fokko commented on code in PR #1978:
URL: https://github.com/apache/iceberg-rust/pull/1978#discussion_r2658464124
##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -506,6 +506,19 @@ impl TableMetadata {
/// If the default sort order is unsorted but the sort order is not
present, add it
fn try_normalize_sort_order(&mut self) -> Result<()> {
+ // Validate that sort order ID 0 (reserved for unsorted) has no fields
+ if let Some(sort_order) =
self.sort_order_by_id(SortOrder::UNSORTED_ORDER_ID)
+ && !sort_order.fields.is_empty()
+ {
+ return Err(Error::new(
Review Comment:
Do we want to fail, or do we want to drop the fields and emit a warning?
--
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]