public Schema convert(List<String> columnNames, List<TypeInfo> columnTypes,
                        List<String> columnComments, String namespace, String name, String doc) {

    List<Schema.Field> fields = new ArrayList<Schema.Field>();
    for (int i = 0; i < columnNames.size(); ++i) {
      final String comment = columnComments.size() > i ? columnComments.get(i) : null;
      final Schema.Field avroField = createAvroField(columnNames.get(i), columnTypes.get(i),
          comment);
      fields.addAll(getFields(avroField));
    }

    if (name == null || name.isEmpty()) {
      name = "baseRecord";
    }

    Schema avroSchema = Schema.createRecord(name, doc, namespace, false);
    avroSchema.setFields(fields);
    return avroSchema;
  }
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