public static HCatFieldSchema getHCatFieldSchema(FieldSchema fs) throws HCatException {
    String fieldName = fs.getName();
    TypeInfo baseTypeInfo = TypeInfoUtils.getTypeInfoFromTypeString(fs.getType());
    return getHCatFieldSchema(fieldName, baseTypeInfo, fs.getComment());
  }
@Test
  public void testHCatFieldSchemaConversion() throws Exception {
	  FieldSchema stringFieldSchema = new FieldSchema("name1", serdeConstants.STRING_TYPE_NAME, "comment1");
	  HCatFieldSchema stringHCatFieldSchema = HCatSchemaUtils.getHCatFieldSchema(stringFieldSchema);
	  assertEquals(stringHCatFieldSchema.getName(), "name1");
	  assertEquals(stringHCatFieldSchema.getCategory(), Category.PRIMITIVE);
	  assertEquals(stringHCatFieldSchema.getComment(), "comment1");

	  FieldSchema listFieldSchema = new FieldSchema("name1", "array<tinyint>", "comment1");
	  HCatFieldSchema listHCatFieldSchema = HCatSchemaUtils.getHCatFieldSchema(listFieldSchema);
	  assertEquals(listHCatFieldSchema.getName(), "name1");
	  assertEquals(listHCatFieldSchema.getCategory(), Category.ARRAY);
	  assertEquals(listHCatFieldSchema.getComment(), "comment1");

	  FieldSchema mapFieldSchema = new FieldSchema("name1", "map<string,int>", "comment1");
	  HCatFieldSchema mapHCatFieldSchema = HCatSchemaUtils.getHCatFieldSchema(mapFieldSchema);
	  assertEquals(mapHCatFieldSchema.getName(), "name1");
	  assertEquals(mapHCatFieldSchema.getCategory(), Category.MAP);
	  assertEquals(mapHCatFieldSchema.getComment(), "comment1");

	  FieldSchema structFieldSchema = new FieldSchema("name1", "struct<s:string,i:tinyint>", "comment1");
	  HCatFieldSchema structHCatFieldSchema = HCatSchemaUtils.getHCatFieldSchema(structFieldSchema);
	  assertEquals(structHCatFieldSchema.getName(), "name1");
	  assertEquals(structHCatFieldSchema.getCategory(), Category.STRUCT);
	  assertEquals(structHCatFieldSchema.getComment(), "comment1");
  }