public static void testConversion(
      final String columnNamesStr,
      final String columnsTypeStr,
      final String actualSchema,
      final Configuration conf) throws Exception {
    final List<String> columnNames = createHiveColumnsFrom(columnNamesStr);
    final List<TypeInfo> columnTypes = createHiveTypeInfoFrom(columnsTypeStr);
    final MessageType messageTypeFound = HiveSchemaConverter.convert(columnNames, columnTypes,
        conf);
    final MessageType expectedMT = MessageTypeParser.parseMessageType(actualSchema);
    assertEquals("converting " + columnNamesStr + ": " + columnsTypeStr + " to " + actualSchema,
      expectedMT, messageTypeFound);

    // Required to check the original types manually as PrimitiveType.equals does not care about it
    List<Type> expectedFields = expectedMT.getFields();
    List<Type> actualFields = messageTypeFound.getFields();
    for (int i = 0, n = expectedFields.size(); i < n; ++i) {

      LogicalTypeAnnotation expectedLogicalType = expectedFields.get(i).getLogicalTypeAnnotation();
      LogicalTypeAnnotation actualLogicalType = actualFields.get(i).getLogicalTypeAnnotation();
      assertEquals("Logical type annotations of the field do not match", expectedLogicalType, actualLogicalType);
    }
  }
Only use if Configuration/HiveConf not needed for converting schema.
ql/src/test/org/apache/hadoop/hive/ql/io/parquet/HiveParquetSchemaTestUtils.java