return pigObj;
case SMALLINT:
case TINYINT:
case BOOLEAN:
// would not pass schema validation anyway
throw new BackendException("Incompatible type "+type+" found in hcat table schema: "+hcatFS, PigHCatUtil.PIG_EXCEPTION_CODE);
default:
throw new BackendException("Unexpected type "+type+" for value "+pigObj + (pigObj == null ? "" : " of class " + pigObj.getClass().getName()), PigHCatUtil.PIG_EXCEPTION_CODE);
}
} catch (BackendException e) {
// provide the path to the field in the error message
throw new BackendException(
(hcatFS.getName() == null ? " " : hcatFS.getName()+".") + e.getMessage(),
e.getCause() == null ? e : e.getCause());
}
}