private void deserializeAndSerializeHBaseValueStruct(HBaseSerDe serDe, Result r, Put p)
      throws SerDeException, IOException {
    StructObjectInspector soi = (StructObjectInspector) serDe.getObjectInspector();

    List<? extends StructField> fieldRefs = soi.getAllStructFieldRefs();

    Object row = serDe.deserialize(new ResultWritable(r));

    Object fieldData = null;
    for (int j = 0; j < fieldRefs.size(); j++) {
      fieldData = soi.getStructFieldData(row, fieldRefs.get(j));
      assertNotNull(fieldData);
      if (fieldData instanceof LazyStruct) {
        assertEquals(((LazyStruct) fieldData).getField(0).toString(), "A");
        assertEquals(((LazyStruct) fieldData).getField(1).toString(), "B");
        assertEquals(((LazyStruct) fieldData).getField(2).toString(), "C");
      } else {
        Assert.fail("fieldData should be an instance of LazyStruct");
      }
    }

    assertEquals(
        "{\"key\":{\"col1\":\"A\",\"col2\":\"B\",\"col3\":\"C\"},\"astring\":{\"col1\":\"A\",\"col2\":\"B\",\"col3\":\"C\"}}",
        SerDeUtils.getJSONString(row, soi));

    // Now serialize
    Put put = ((PutWritable) serDe.serialize(row, soi)).getPut();

    assertEquals("Serialized put:", p.toString(), put.toString());
  }
Since there are assertions in the code, when running this test it throws an assertion error
and not the error in a production setup. The Properties.java object that is passed to the serDe
initializer, is passed with empty value "" for "columns.comments" key for hbase backed tables.
hbase-handler/src/test/org/apache/hadoop/hive/hbase/TestHBaseSerDe.java