private static void updateFromFieldMetrics(
      Map<Integer, FieldMetrics<?>> idToFieldMetricsMap,
      MetricsConfig metricsConfig,
      Schema schema,
      Map<Integer, Literal<?>> lowerBounds,
      Map<Integer, Literal<?>> upperBounds) {
    idToFieldMetricsMap
        .entrySet()
        .forEach(
            entry -> {
              int fieldId = entry.getKey();
              FieldMetrics<?> metrics = entry.getValue();
              MetricsModes.MetricsMode metricsMode =
                  MetricsUtil.metricsMode(schema, metricsConfig, fieldId);

              // only check for MetricsModes.None, since we don't truncate float/double values.
              if (metricsMode != MetricsModes.None.get()) {
                if (!metrics.hasBounds()) {
                  lowerBounds.remove(fieldId);
                  upperBounds.remove(fieldId);
                } else if (metrics.upperBound() instanceof Float) {
                  lowerBounds.put(fieldId, Literal.of((Float) metrics.lowerBound()));
                  upperBounds.put(fieldId, Literal.of((Float) metrics.upperBound()));
                } else if (metrics.upperBound() instanceof Double) {
                  lowerBounds.put(fieldId, Literal.of((Double) metrics.lowerBound()));
                  upperBounds.put(fieldId, Literal.of((Double) metrics.upperBound()));
                } else {
                  throw new UnsupportedOperationException(
                      "Expected only float or double column metrics");
                }
              }
            });
  }
Copy from {@link ParquetUtil} to resolve int96 in metric.
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetUtil.java