private void deserializeAndSerializeHiveStructColumnFamily(HBaseSerDe serDe, Result r, Put p,
      Object[] expectedFieldsData,
      int[] expectedMapSize, List<Object> expectedQualifiers, Object notPresentKey)
      throws SerDeException, IOException {
    StructObjectInspector soi = (StructObjectInspector) serDe.getObjectInspector();

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

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

    int k = 0;

    for (int i = 0; i < fieldRefs.size(); i++) {
      Object fieldData = soi.getStructFieldData(row, fieldRefs.get(i));
      assertNotNull(fieldData);

      if (fieldData instanceof LazyPrimitive<?, ?>) {
        assertEquals(expectedFieldsData[i], ((LazyPrimitive<?, ?>) fieldData).getWritableObject());
      } else if (fieldData instanceof LazyHBaseCellMap) {

        for (int j = 0; j < ((LazyHBaseCellMap) fieldData).getMapSize(); j++) {
          assertEquals(expectedFieldsData[k + 1],
              ((LazyHBaseCellMap) fieldData).getMapValueElement(expectedQualifiers.get(k))
                  .toString().trim());
          k++;
        }

        assertEquals(expectedMapSize[i - 1], ((LazyHBaseCellMap) fieldData).getMapSize());

        // Make sure that the unwanted key is not present in the map
        assertNull(((LazyHBaseCellMap) fieldData).getMapValueElement(notPresentKey));

      } else {
        fail("Error: field data not an instance of LazyPrimitive<?, ?> or LazyHBaseCellMap");
      }
    }

    SerDeUtils.getJSONString(row, soi);

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

    assertNotNull(put);
  }
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