private static Function<Object, Object> converterFor(
      PrimitiveType parquetType, Type icebergType) {
    Function<Object, Object> fromParquet = ParquetConversions.converterFromParquet(parquetType);
    if (icebergType != null) {
      if (icebergType.typeId() == Type.TypeID.LONG
          && parquetType.getPrimitiveTypeName() == PrimitiveType.PrimitiveTypeName.INT32) {
        return value -> ((Integer) fromParquet.apply(value)).longValue();
      } else if (icebergType.typeId() == Type.TypeID.DOUBLE
          && parquetType.getPrimitiveTypeName() == PrimitiveType.PrimitiveTypeName.FLOAT) {
        return value -> ((Float) fromParquet.apply(value)).doubleValue();
      }
    }

    return fromParquet;
  }
Checks against older versions of Parquet statistics which may have a null count but undefined
min and max statistics. Returns true if nonNull values exist in the row group but no further
statistics are available.

<p>We can't use {@code statistics.hasNonNullValue()} because it is inaccurate with older files
and will return false if min and max are not set.

<p>This is specifically for 1.5.0-CDH Parquet builds and later which contain the different
unusual hasNonNull behavior. OSS Parquet builds are not effected because PARQUET-251 prohibits
the reading of these statistics from versions of Parquet earlier than 1.8.0.

@param statistics Statistics to check
@param valueCount Number of values in the row group
@return true if nonNull values exist and no other stats can be used
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetMetricsRowGroupFilter.java