private Schema createAvroMap(TypeInfo typeInfo) {
    TypeInfo keyTypeInfo = ((MapTypeInfo) typeInfo).getMapKeyTypeInfo();
    if (((PrimitiveTypeInfo) keyTypeInfo).getPrimitiveCategory()
        != PrimitiveObjectInspector.PrimitiveCategory.STRING) {
      throw new UnsupportedOperationException("Key of Map can only be a String");
    }

    TypeInfo valueTypeInfo = ((MapTypeInfo) typeInfo).getMapValueTypeInfo();
    Schema valueSchema = createAvroSchema(valueTypeInfo);

    return Schema.createMap(valueSchema);
  }
Converts Hive schema to avro schema

@param columnNames Names of the hive columns
@param columnTypes Hive Column types
@param namespace   Namespace of Avro schema
@param name        Avro schema name
@param doc         Avro schema doc
@return Avro Schema
serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java