private static void updateNestedField(
      Type.NestedType newType,
      Type.NestedType oldType,
      UpdateSchema us,
      String fieldPrefix,
      Collection<Add> adds) {
    if (Objects.equals(newType, oldType)) {
      return;
    }
    newType
        .fields()
        .forEach(
            (field -> {
              Types.NestedField old = oldType.field(field.fieldId());
              syncField(field, old, us, fieldPrefix, adds);
            }));

    oldType
        .fields()
        .forEach(
            (o -> {
              // won't sync repeatedly
              if (newType.field(o.fieldId()) == null) {
                syncField(null, o, us, fieldPrefix, adds);
              }
            }));
  }
Apply the pending changes to the original schema and returns the result.

<p>This does not result in a permanent update.

@return the result Schema when all pending updates are applied
amoro-format-iceberg/src/main/java/org/apache/amoro/op/KeyedSchemaUpdate.java