public static boolean queryHistoryRecordsAreEqual(Record thiz, Record obj){
    if (thiz == obj) {
      return true;
    }

    if (obj == null) {
      return false;
    }

    Record other = (Record) obj;

    for (Schema.Field field : Schema.Field.values()) {
      Object valueThis = thiz.get(field);
      Object valueThat = other.get(field);
      if ((valueThis != null && valueThat == null) || (valueThis == null && valueThat != null)) {
        LOG.info("Record equality check: fields differ in null value: {}", field.getName());
        return false;
      }
      if (valueThis instanceof Timestamp || valueThat instanceof Timestamp){
        boolean timesEquals = compareTimes(valueThis, valueThat);
        if (!timesEquals){
          return false;
        }
        continue; // check next field
      }
      if (valueThis != null && !valueThis.equals(valueThat)) {
        LOG.info("Record equality check: fields are not equal: {}, this: {} (type: {})," +
            " that: {} (type: {})",
            field.getName(),
            valueThis, valueThis.getClass(), valueThat, valueThat.getClass());
        return false;
      }
    }
    return true;
  }
Special equality method for datetime fields in a Record. This is because hive's Timestamp
after being serialized and de-serialized ends up becoming a LocalDateTime, and a TimeStamp.equals
(LocalDateTime) would simply return non-equality, even if the inner LocalDateTime instance points to the
same moment in time as the other LocalDateTime instance.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/queryhistory/schema/QueryHistorySchemaTestUtils.java