params = new HashMap<>(); if (!isCreate && isTransactionalTable(table.getParameters())) {
long lockId; if (acquireLock && lockRequired && table.getParameters() != null && MetaStoreServerUtils.isTransactionalTable(table.getParameters())) {
/** * Checks if the table is valid based on the rules for strict managed tables. * @param conf * @param table * @return Null if the table is valid, otherwise a string message indicating why the table is invalid. */ public static String validateStrictManagedTable(Configuration conf, Table table) { if (MetastoreConf.getBoolVar(conf, MetastoreConf.ConfVars.STRICT_MANAGED_TABLES)) { if (table.isTemporary()) { // temp tables exempted from checks. return null; } TableType tableType = TableType.valueOf(table.getTableType()); if (tableType == TableType.MANAGED_TABLE) { if (!MetaStoreServerUtils.isTransactionalTable(table.getParameters())) { return createValidationError(table, "Table is marked as a managed table but is not transactional."); } if (MetaStoreUtils.isNonNativeTable(table)) { return createValidationError(table, "Table is marked as a managed table but is non-native."); } if (isAvroTableWithExternalSchema(table)) { return createValidationError(table, "Managed Avro table has externally defined schema."); } } } // Table is valid return null; }