ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedUtils.java
public static String validateStrictManagedTable(Configuration conf,
      org.apache.hadoop.hive.metastore.api.Table table) {
    if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_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 (!AcidUtils.isTransactionalTable(table)) {
          String inputFormat = null;
          if (table.getSd() != null) {
            inputFormat = table.getSd().getInputFormat();
          }
          if (!EXEMPT_INPUTFORMATS.contains(inputFormat)) {
            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;
  }
/**
   * 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.
   */
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.
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,
      org.apache.hadoop.hive.metastore.api.Table table) {
    if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_STRICT_MANAGED_TABLES)) {
      if (table.isTemporary()) {
        return null;
      }
      TableType tableType = TableType.valueOf(table.getTableType());
      if (tableType == TableType.MANAGED_TABLE) {
        if (!AcidUtils.isTransactionalTable(table)) {
          String inputFormat = null;
          if (table.getSd() != null) {
            inputFormat = table.getSd().getInputFormat();
          }
          if (!EXEMPT_INPUTFORMATS.contains(inputFormat)) {
            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.");
        }
      }
    }
    return null;
  }
public static String validateStrictManagedTable ( Configuration conf , org . apache . hadoop . hive . metastore . api . Table table ) { if ( HiveConf . getBoolVar ( conf , HiveConf . ConfVars . HIVE_STRICT_MANAGED_TABLES ) ) { if ( table . isTemporary ( ) ) { return null ; } TableType tableType = TableType . valueOf ( table . getTableType ( ) ) ; if ( tableType == TableType . MANAGED_TABLE ) { if ( ! AcidUtils . isTransactionalTable ( table ) ) { String inputFormat = null ; if ( table . getSd ( ) != null ) { inputFormat = table . getSd ( ) . getInputFormat ( ) ; } if ( ! EXEMPT_INPUTFORMATS . contains ( inputFormat ) ) { 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." ) ; } } } return null ; }
Checks if the table is valid based on the rules for strict managed tables.
Checks if the table is valid based on the rules for strict managed tables .
// temp tables exempted from checks. // Table is valid