Source:
<code>public void alterTable(ObjectPath tablePath, CatalogBaseTable newCatalogTable, boolean ignoreIfNotExists) throws TableNotExistException, CatalogException { checkNotNull(tablePath, "tablePath cannot be null"); checkNotNull(newCatalogTable, "newCatalogTable cannot be null"); <START> <END> Table hiveTable; try { hiveTable = getHiveTable(tablePath); } catch (TableNotExistException e) { if (!ignoreIfNotExists) { throw e; } return; } CatalogBaseTable existingTable = instantiateCatalogTable(hiveTable, hiveConf); if (existingTable.getClass() != newCatalogTable.getClass()) { throw new CatalogException( String.format("Table types don't match. Existing table is '%s' and new table is '%s'.", existingTable.getClass().getName(), newCatalogTable.getClass().getName())); } boolean isGeneric = isGenericForGet(hiveTable.getParameters()); if (isGeneric) { hiveTable = alterTableViaCatalogBaseTable(tablePath, newCatalogTable, hiveTable); } else { AlterTableOp op = extractAlterTableOp(newCatalogTable.getOptions()); if (op == null) { hiveTable = alterTableViaCatalogBaseTable(tablePath, newCatalogTable, hiveTable); } else { alterTableViaProperties(op, hiveTable, hiveTable.getParameters(), newCatalogTable.getProperties(), hiveTable.getSd()); } } disallowChangeIsGeneric(isGeneric, isGenericForGet(hiveTable.getParameters())); try { client.alter_table(tablePath.getDatabaseName(), tablePath.getObjectName(), hiveTable); } catch (TException e) { throw new CatalogException(String.format("Failed to alter table %s", tablePath.getFullName()), e); } }</code><technical_language>Move alter util? a AlterTable, implementation: ObjectAlterTable PropertiesAlterTable</technical_language>

Target:
public void alterTable(ObjectPath tablePath, CatalogBaseTable newCatalogTable, boolean ignoreIfNotExists) throws TableNotExistException, CatalogException { checkNotNull(tablePath, "tablePath cannot be null"); checkNotNull(newCatalogTable, "newCatalogTable cannot be null"); Table hiveTable; try { hiveTable = getHiveTable(tablePath); } catch (TableNotExistException e) { if (!ignoreIfNotExists) { throw e; } return; } CatalogBaseTable existingTable = instantiateCatalogTable(hiveTable, hiveConf); if (existingTable.getClass() != newCatalogTable.getClass()) { throw new CatalogException( String.format("Table types don't match. Existing table is '%s' and new table is '%s'.", existingTable.getClass().getName(), newCatalogTable.getClass().getName())); } boolean isGeneric = isGenericForGet(hiveTable.getParameters()); if (isGeneric) { hiveTable = HiveTableUtil.alterTableViaCatalogBaseTable(tablePath, newCatalogTable, hiveTable, hiveConf); } else { AlterTableOp op = HiveTableUtil.extractAlterTableOp(newCatalogTable.getOptions()); if (op == null) { hiveTable = HiveTableUtil.alterTableViaCatalogBaseTable(tablePath, newCatalogTable, hiveTable, hiveConf); } else { alterTableViaProperties( op, hiveTable, (CatalogTable) newCatalogTable, hiveTable.getParameters(), newCatalogTable.getProperties(), hiveTable.getSd()); } } disallowChangeIsGeneric(isGeneric, isGenericForGet(hiveTable.getParameters())); try { client.alter_table(tablePath.getDatabaseName(), tablePath.getObjectName(), hiveTable); } catch (TException e) { throw new CatalogException(String.format("Failed to alter table %s", tablePath.getFullName()), e); } }