From d73be1695de5336d89f1d715acb3d7361828a16d Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Tue, 19 Dec 2023 23:17:17 +0900 Subject: [PATCH] Add comment why disabling pushdown on MariaDB REAL type --- .../src/main/java/io/trino/plugin/mariadb/MariaDbClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbClient.java b/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbClient.java index 23dbb45e3310..af3a6c0ecca8 100644 --- a/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbClient.java +++ b/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbClient.java @@ -339,6 +339,8 @@ public Optional toColumnMapping(ConnectorSession session, Connect case Types.BIGINT: return Optional.of(bigintColumnMapping()); case Types.REAL: + // Disable pushdown because floating-point values are approximate and not stored as exact values, + // attempts to treat them as exact in comparisons may lead to problems return Optional.of(ColumnMapping.longMapping( REAL, (resultSet, columnIndex) -> floatToRawIntBits(resultSet.getFloat(columnIndex)),