pvary commented on code in PR #12897: URL: https://github.com/apache/iceberg/pull/12897#discussion_r2161244726
########## api/src/main/java/org/apache/iceberg/PartitionSpec.java: ########## @@ -636,15 +648,20 @@ static void checkCompatibility(PartitionSpec spec, Schema schema) { // checks if (!transform.equals(Transforms.alwaysNull())) { ValidationException.check( - sourceType != null, "Cannot find source column for partition field: %s", field); - ValidationException.check( - sourceType.isPrimitiveType(), - "Cannot partition by non-primitive source field: %s", - sourceType); + !sourceTypes.isEmpty(), "Cannot find source column for partition field: %s", field); + for (Type sourceType : sourceTypes) { + ValidationException.check( + sourceType != null, "Cannot find source column for partition field: %s", field); + ValidationException.check( + sourceType.isPrimitiveType(), + "Cannot partition by non-primitive source field: %s (%s)", + field, + sourceType); + } Review Comment: nit: newline -- 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