public static void syncSchema(KeyedTable keyedTable) {
    if (PrimaryKeySpec.noPrimaryKey().equals(keyedTable.primaryKeySpec())) {
      return;
    }

    int baseSchemaSize = keyedTable.baseTable().schemas().size();
    int changeSchemaSize = keyedTable.changeTable().schemas().size();
    if (baseSchemaSize <= changeSchemaSize) {
      return;
    }
    if (baseSchemaSize == changeSchemaSize + 1) {
      Schema newer = keyedTable.baseTable().schema();
      syncSchema(newer, keyedTable.changeTable().schema(), keyedTable.changeTable().updateSchema());
      return;
    }
    // just allow base table schema's versions are one more than change table's
    throw new IllegalStateException("base table have two more versions than change table");
  }
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