@Override
      protected void update(Object p, PrimitiveObjectInspector inputOI) {
        // TimestampWritableV2 is mutable, TimestampStatsAgg needs its own copy
        TimestampWritableV2 v = new TimestampWritableV2((TimestampWritableV2) inputOI.getPrimitiveWritableObject(p));

        //Update min counter if new value is less than min seen so far
        if (min == null || v.compareTo(min) < 0) {
          min = v;
        }
        //Update max counter if new value is greater than max seen so far
        if (max == null || v.compareTo(max) > 0) {
          max = v;
        }
        // Add value to NumDistinctValue Estimator
        numDV.addToEstimator(v.getSeconds());
      }
GenericUDAFTimestampStatsEvaluator
High/low value will be saved in stats DB as long value representing seconds since epoch.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFComputeStats.java