private static int getIntValue(Object obj) {
    int value = 0;
    if (obj instanceof Integer) {
      value = (int) obj;
    } else if (obj instanceof String && StringUtils.isNumeric((String)obj)) {
      value = Integer.parseInt((String)obj);
    }
    return value;
  }
Convert an Avro Schema into an equivalent Hive TypeInfo.
@param schema to record. Must be of record type.
@param seenSchemas stores schemas processed in the parsing done so far,
        helping to resolve circular references in the schema
@return TypeInfo matching the Avro schema
@throws AvroSerdeException for any problems during conversion.
serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java