rdblue commented on code in PR #5627: URL: https://github.com/apache/iceberg/pull/5627#discussion_r956788471
########## python/pyiceberg/table/sorting.py: ########## @@ -135,3 +140,31 @@ def __str__(self) -> str: UNSORTED_SORT_ORDER_ID = 0 UNSORTED_SORT_ORDER = SortOrder(order_id=UNSORTED_SORT_ORDER_ID) +INITIAL_SORT_ORDER_ID = 1 + + +def assign_fresh_sort_order_ids(sort_order: SortOrder, old_schema: Schema, fresh_schema: Schema) -> SortOrder: + if sort_order.is_unsorted: + return UNSORTED_SORT_ORDER + + fresh_fields = [] + for field in sort_order.fields: + original_field = old_schema.find_field(field.source_id) + if original_field is None: + raise ValueError(f"Could not find in original schema: {field}") + fresh_field = fresh_schema.find_field(original_field.name) Review Comment: This still needs to be addressed as well. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org