@Test
  public void testHBaseSerDeWithAvroExternalSchema() throws SerDeException, IOException {
    byte[] cfa = "cola".getBytes();

    byte[] qualAvro = "avro".getBytes();

    byte[] rowKey = Bytes.toBytes("test-row1");

    // Data
    List<Cell> kvs = new ArrayList<Cell>();

    byte[] avroData = getTestAvroBytesFromClass2(1);

    kvs.add(new KeyValue(rowKey, cfa, qualAvro, avroData));

    Result r = Result.create(kvs);

    Put p = new Put(rowKey);

    // Post serialization, separators are automatically inserted between different fields in the
    // struct. Currently there is not way to disable that. So the work around here is to pad the
    // data with the separator bytes before creating a "Put" object
    p.add(new KeyValue(rowKey, cfa, qualAvro, avroData));

    Object[] expectedFieldsData = {
        new String("test-row1"),
        new String(
            "[Avro Employee1, 11111, 25, FEMALE, [[[Avro First Address1, Avro Second Address1, Avro City1, 123456, 0:[999, 1234567890], null, {testkey=testvalue}], [Avro First Address1, Avro Second Address1, Avro City1, 123456, 0:[999, 1234567890], null, {testkey=testvalue}]], "
                + "[999, 1234567890], [999, 1234455555]]]")};

    // Create, initialize, and test the SerDe
    HBaseSerDe serDe = new HBaseSerDe();
    Configuration conf = new Configuration();

    Properties tbl = createPropertiesForHiveAvroExternalSchema();
    serDe.initialize(conf, tbl, null);

    deserializeAndSerializeHiveAvro(serDe, r, p, expectedFieldsData,
        EXPECTED_DESERIALIZED_AVRO_STRING_2);
  }
Test the default behavior of the Lazy family of objects and object inspectors.
hbase-handler/src/test/org/apache/hadoop/hive/hbase/TestHBaseSerDe.java