@Override
    PrimitiveConverter getConverter(final PrimitiveType type, final int index, final ConverterParent parent, TypeInfo hiveTypeInfo) {
      if (hiveTypeInfo != null) {
        String typeName = TypeInfoUtils.getBaseName(hiveTypeInfo.getTypeName());
        final double minValue = getMinValue(typeName, Double.MIN_VALUE);
        final double maxValue = getMaxValue(typeName, Double.MAX_VALUE);

        switch (typeName) {
        case serdeConstants.FLOAT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              double absValue = (value < 0) ? (value * -1) : value;
              int exponent = Math.getExponent(value);
              if ((absValue >= minValue) && (absValue <= maxValue) &&
                  (exponent <= Float.MAX_EXPONENT) && (exponent >= Float.MIN_EXPONENT)) {
                parent.set(index, new FloatWritable((float) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.DECIMAL_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              HiveDecimalWritable decimalWritable = new HiveDecimalWritable();
              decimalWritable.setFromDouble(value);
              parent.set(index, HiveDecimalUtils
                  .enforcePrecisionScale(decimalWritable, (DecimalTypeInfo) hiveTypeInfo));
            }
          };
        case serdeConstants.BIGINT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              if ((value >= minValue) && (value <= maxValue) && (value % 1 == 0)) {
                parent.set(index, new LongWritable((long) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.INT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              if ((value >= minValue) && (value <= maxValue) && (value % 1 == 0)) {
                parent.set(index, new IntWritable((int) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.SMALLINT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              if ((value >= minValue) && (value <= maxValue) && (value % 1 == 0)) {
                parent.set(index, new IntWritable((int) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.TINYINT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              if ((value >= minValue) && (value <= maxValue) && (value % 1 == 0)) {
                parent.set(index, new IntWritable((int) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        default:
          return new PrimitiveConverter() {
            @Override
            public void addDouble(final double value) {
              parent.set(index, new DoubleWritable(value));
            }
          };
        }
      }
      return new PrimitiveConverter() {
        @Override
        public void addDouble(final double value) {
          parent.set(index, new DoubleWritable(value));
        }
      };
    }
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