diff --git a/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchMetadata.java b/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchMetadata.java index 3ddc4ccabafb..4d5beb86e60e 100644 --- a/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchMetadata.java +++ b/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchMetadata.java @@ -52,6 +52,7 @@ import io.trino.spi.statistics.Estimate; import io.trino.spi.statistics.TableStatistics; import io.trino.spi.statistics.TableStatisticsMetadata; +import io.trino.spi.type.DecimalType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; import io.trino.tpch.Distributions; @@ -368,7 +369,7 @@ private static double toDouble(Object value, Type columnType) if (columnType.equals(BIGINT) || columnType.equals(INTEGER) || columnType.equals(DATE)) { return ((Number) value).longValue(); } - if (columnType.equals(DOUBLE)) { + if (columnType.equals(DOUBLE) || columnType instanceof DecimalType) { return ((Number) value).doubleValue(); } }