private void verifyRead(
      DeserializeRead deserializeRead, TypeInfo typeInfo, Object expectedObject) throws IOException {

    if (typeInfo.getCategory() == ObjectInspector.Category.PRIMITIVE) {
      VectorVerifyFast.verifyDeserializeRead(deserializeRead, typeInfo, expectedObject);
    } else {
      Object complexFieldObj = VectorVerifyFast.deserializeReadComplexType(deserializeRead, typeInfo);
      if (expectedObject == null) {
        if (complexFieldObj != null) {
          fail("Field reports not null but object is null (class " + complexFieldObj.getClass().getName() +
              ", " + complexFieldObj.toString() + ")");
        }
      } else {
        if (complexFieldObj == null) {
          // It's hard to distinguish a union with null from a null union.
          if (expectedObject instanceof UnionObject) {
            UnionObject expectedUnion = (UnionObject) expectedObject;
            if (expectedUnion.getObject() == null) {
              return;
            }
          }
          fail("Field reports null but object is not null (class " + expectedObject.getClass().getName() +
              ", " + expectedObject.toString() + ")");
        }
      }
      if (!VerifyLazy.lazyCompare(typeInfo, complexFieldObj, expectedObject)) {
        fail("Comparision failed typeInfo " + typeInfo.toString());
      }
    }
  }
Unit test for the vectorized serialize and deserialize row.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSerDeRow.java