private static long getMaxValue(String typeName, long defaultValue) {
    switch (typeName) {
    case serdeConstants.INT_TYPE_NAME:
      return Integer.MAX_VALUE;
    case serdeConstants.SMALLINT_TYPE_NAME:
      return Short.MAX_VALUE;
    case serdeConstants.TINYINT_TYPE_NAME:
      return Byte.MAX_VALUE;
    default:
      return defaultValue;
    }
  }
ETypeConverter is an easy way to set the converter for the right type.
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java