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

        switch (typeName) {
        case serdeConstants.FLOAT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addLong(final long value) {
              if (value >= minValue) {
                parent.set(index, new FloatWritable(value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.DOUBLE_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addLong(final long value) {
              if (value >= minValue) {
                parent.set(index, new DoubleWritable(value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.DECIMAL_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addLong(long value) {
              if (value >= minValue) {
                parent.set(index, HiveDecimalUtils
                    .enforcePrecisionScale(new HiveDecimalWritable(value),
                        (DecimalTypeInfo) hiveTypeInfo));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.INT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addLong(long value) {
              if ((value >= minValue) && (value <= maxValue)) {
                parent.set(index, new IntWritable((int) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.SMALLINT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addLong(long value) {
              if ((value >= minValue) && (value <= maxValue)) {
                parent.set(index, new IntWritable((int) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.TINYINT_TYPE_NAME:
          return new PrimitiveConverter() {
            @Override
            public void addLong(long value) {
              if ((value >= minValue) && (value <= maxValue)) {
                parent.set(index, new IntWritable((int) value));
              } else {
                parent.set(index, null);
              }
            }
          };
        case serdeConstants.TIMESTAMP_TYPE_NAME:
        case serdeConstants.TIMESTAMPLOCALTZ_TYPE_NAME:
          if (type.getLogicalTypeAnnotation() instanceof TimestampLogicalTypeAnnotation) {
            TimestampLogicalTypeAnnotation logicalType =
                (TimestampLogicalTypeAnnotation) type.getLogicalTypeAnnotation();
            return new PrimitiveConverter() {
              @Override
              public void addLong(final long value) {
                Timestamp timestamp =
                    ParquetTimestampUtils.getTimestamp(value, logicalType.getUnit(), logicalType.isAdjustedToUTC());
                parent.set(index, new TimestampWritableV2(timestamp));
              }
            };
          }
          throw new IllegalStateException("Cannot reliably convert INT64 value to timestamp without type annotation");
        default:
          return new PrimitiveConverter() {
            @Override
            public void addLong(final long value) {
              if (value >= minValue) {
                parent.set(index, new LongWritable(value));
              } else {
                parent.set(index, null);
              }
            }
          };
        }
      }
      return new PrimitiveConverter() {
        @Override
        public void addLong(final long value) {
          if (value >= ((ETypeConverter.isUnsignedInteger(type)) ? 0 : Long.MIN_VALUE)) {
            parent.set(index, new LongWritable(value));
          } else {
            parent.set(index, null);
          }
        }
      };
    }
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