private static void throwTypeMismatchException(byte pigDataType,
      List<Type> hcatRequiredType, HCatFieldSchema hcatActualField, 
      int columnPos) throws FrontendException {
    if(!hcatRequiredType.contains(hcatActualField.getType())) {
      throw new FrontendException( 
              "Pig '" + DataType.findTypeName(pigDataType) + "' type in column " + 
              columnPos + "(0-based) cannot map to HCat '" + 
              hcatActualField.getType() + "'type.  Target filed must be of HCat type {" +
              StringUtils.join(hcatRequiredType, " or ") + "}");
    }
  }
This method encodes which Pig type can map (be stored in) to which HCat type.
@throws HCatException
@throws FrontendException
hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatBaseStorer.java