danielcweeks commented on code in PR #12651: URL: https://github.com/apache/iceberg/pull/12651#discussion_r2025570136
########## api/src/main/java/org/apache/iceberg/PartitionSpec.java: ########## @@ -265,6 +265,22 @@ public boolean equals(Object other) { return Arrays.equals(fields, that.fields); } + public boolean equalOrFinerThan(PartitionSpec that) { + if (this.fields.length < that.fields.length) { + return false; + } + + for (int i = 0; i < that.fields.length; i++) { + if (this.fields[i].sourceId() != that.fields[i].sourceId()) { Review Comment: I think we're making an incorrect assumption here about field ordering. I can have the following specs: ```java spec 1: identity(f1), identity(f2) spec 2: identify(f2), identity(f1), identity(f3) ``` Which are both valid specs for the same schema and would fail in this scenario where spec 2 is finer than spec 1. -- 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