public static void validateStrictManagedTableWithThrow(Configuration conf, Table table) throws MetaException { String reason = validateStrictManagedTable(conf, table); if (reason != null) { throw new MetaException(reason); } }
public static boolean migrateTable(Table tableObj, TableType tableType, TableMigrationOption migrationOption, boolean dryRun, HiveUpdater hiveUpdater, IMetaStoreClient hms, Configuration conf) throws HiveException, IOException, TException { switch (migrationOption) { case EXTERNAL: migrateToExternalTable(tableObj, tableType, dryRun, hiveUpdater); break; case MANAGED: migrateToManagedTable(tableObj, tableType, dryRun, hiveUpdater, hms, conf); break; case NONE: break; case VALIDATE: // Check that the table is valid under strict managed tables mode. String reason = HiveStrictManagedUtils.validateStrictManagedTable(conf, tableObj); if (reason != null) { LOG.warn(reason); return true; } break; default: throw new IllegalArgumentException("Unexpected table migration option " + migrationOption); } return false; }