private void handleOutOfRangeValue(Object pigObj, HCatFieldSchema hcatFS, String additionalMsg) throws BackendException {
    String msg = "Pig value '" + pigObj + "' is outside the bounds of column " + hcatFS.getName() +
      " with type " + (hcatFS.getTypeInfo() == null ? hcatFS.getType() : hcatFS.getTypeInfo().getTypeName()) +
      (additionalMsg == null ? "" : "[" + additionalMsg + "]");
    switch (onOutOfRange) {
      case Throw:
        throw new BackendException(msg, PigHCatUtil.PIG_EXCEPTION_CODE);
      case Null:
        dataLossLogger.logDataLossMsg(hcatFS, pigObj, msg);
        break;
      default:
        throw new BackendException("Unexpected " + ON_OOR_VALUE_OPT + " value: '" + onOutOfRange + "'");
    }
  }
depending on user config, throws an exception or logs a msg if the incoming Pig value is
out-of-range for target type.
@param additionalMsg may be {@code null}
hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatBaseStorer.java