@Override
      protected void updateMax(Object maxValue, DateObjectInspector maxFieldOI) {
        if ((maxValue != null) && (max == null ||
            max.compareTo(maxFieldOI.getPrimitiveWritableObject(maxValue)) < 0)) {
          // DateWritableV2 is mutable, DateStatsAgg needs its own copy
          max = new DateWritableV2(maxFieldOI.getPrimitiveWritableObject(maxValue));
        }
      }
GenericUDAFDateStatsEvaluator
High/low value will be saved in stats DB as long value representing days since epoch.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFComputeStats.java