rdblue commented on a change in pull request #2048:
URL: https://github.com/apache/iceberg/pull/2048#discussion_r558647036
##########
File path: core/src/main/java/org/apache/iceberg/SchemaUpdate.java
##########
@@ -357,7 +357,14 @@ private void internalMove(String name, Move move) {
*/
@Override
public Schema apply() {
- return applyChanges(schema, deletes, updates, adds, moves);
+ Schema newSchema = applyChanges(schema, deletes, updates, adds, moves);
+
+ // Validate the metrics if we have existing properties.
+ if (base != null && base.properties() != null) {
+
MetricsConfig.fromProperties(base.properties()).validateReferencedColumns(newSchema);
+ }
+
+ return newSchema;
Review comment:
I don't think that this path is tested. Could you add one?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]