@InterfaceAudience.LimitedPrivate(value = { "Hive" })
  static int lengthFor(JavaDataModel model, Integer numVector) {
    int length = model.object();
    length += model.primitive1() * 2; // two int
    length += model.primitive2(); // one double
    length += model.lengthForRandom() * 2; // two Random

    if (numVector == null) {
      numVector = 16; // HiveConf hive.stats.ndv.error default produces 16
                      // vectors
    }

    if (numVector > 0) {
      length += model.array() * 3; // three array
      length += model.primitive1() * numVector * 2; // two int array
      length += (model.object() + model.array() + model.primitive1() + model.primitive2())
          * numVector; // bitset array
    }
    return length;
  }
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