try {
Type hType = hcatField.getType();
switch (hType) {
case BOOLEAN:
if (!pigHasBooleanSupport) {
throw new PigException("Incompatible type found in HCat table schema: "
+ hcatField, PigHCatUtil.PIG_EXCEPTION_CODE);
}
break;
case ARRAY:
validateHCatSchemaFollowsPigRules(hcatField.getArrayElementSchema());
break;
case STRUCT:
validateHCatSchemaFollowsPigRules(hcatField.getStructSubSchema());
break;
case MAP:
// key is only string
if (hcatField.getMapKeyType() != Type.STRING) {
LOG.info("Converting non-String key of map " + hcatField.getName() + " from "
+ hcatField.getMapKeyType() + " to String.");
}
validateHCatSchemaFollowsPigRules(hcatField.getMapValueSchema());
break;
}
} catch (HCatException e) {
throw new PigException("Incompatible type found in hcat table schema: " + hcatField, PigHCatUtil.PIG_EXCEPTION_CODE, e);
}
}