{"record":{"id":"6ec2cc04ff309588","repo":"prestodb/presto","slug":"not-supported-6ec2cc","errorCode":"NOT_SUPPORTED","errorMessage":"Unsupported column type: ${type.displayName}","messagePattern":"Unsupported column type: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/QueryBuilder.java","lineNumber":175,"sourceCode":"            Object value = typeAndValue.getValue();\n            if (javaType == boolean.class) {\n                ((BooleanWriteFunction) writeFunction).set(statement, parameterIndex, (boolean) value);\n            }\n            else if (javaType == double.class) {\n                ((DoubleWriteFunction) writeFunction).set(statement, parameterIndex, (double) value);\n            }\n            else if (javaType == long.class) {\n                ((LongWriteFunction) writeFunction).set(statement, parameterIndex, (long) value);\n            }\n            else if (javaType == Slice.class) {\n                ((SliceWriteFunction) writeFunction).set(statement, parameterIndex, (Slice) value);\n            }\n            else {\n                try {\n                    ((ObjectWriteFunction) writeFunction).set(statement, parameterIndex, value);\n                }\n                catch (SQLException e) {\n                    throw new PrestoException(NOT_SUPPORTED, \"Unsupported column type: \" + type.getDisplayName());\n                }\n            }\n        }\n        return statement;\n    }\n\n    public PreparedStatement buildSql(\n            JdbcClient client,\n            ConnectorSession session,\n            Connection connection,\n            String catalog,\n            String schema,\n            String table,\n            List<JdbcColumnHandle> columns,\n            TupleDomain<ColumnHandle> tupleDomain,\n            Optional<JdbcExpression> additionalPredicate)\n            throws SQLException\n    {","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/QueryBuilder.java#L157-L193","documentation":"QueryBuilder.buildSql binds predicate/literal values into a PreparedStatement for a JDBC pushdown query. When the driver's ObjectWriteFunction.set throws SQLException while binding a value, the connector raises NOT_SUPPORTED with the column type's display name. This means the remote JDBC driver cannot accept a bind value of that Presto type in the generated SQL.","triggerScenarios":"Running a query with WHERE/join predicates against a JDBC catalog where pushdown binds a value whose Presto type (e.g. DATE with unexpected precision, TIME, JSON, or a type with no registered write function) is rejected by the driver via SQLException.","commonSituations":"Filtering JDBC tables by timestamp/time columns with driver-specific precision requirements; comparing against Presto-specific types after version upgrades changed type mappings; older database drivers lacking setObject support for certain types.","solutions":["CAST the predicate literal to a broadly supported type in the query, e.g. WHERE ts = CAST('2024-01-01' AS timestamp)","Upgrade the target database's JDBC driver to one that supports the bind type","Disable predicate pushdown for the problematic type (configure the connector to not push down that type) or write the filter as a non-pushable expression so it's evaluated in Presto","If you maintain the connector, add/fix a TypeHandler for that type mapping"],"exampleFix":"// before\nSELECT * FROM jdbc.t WHERE event_time = DATE '2024-01-01 10:00:00.123456';\n// after\nSELECT * FROM jdbc.t WHERE CAST(event_time AS timestamp(6)) = CAST('2024-01-01 10:00:00.123456' AS timestamp(6));","handlingStrategy":"try-catch","validationCode":"// Avoid un-p pushdownable bind types: rewrite literal comparisons with CAST\n// e.g. check predicate literal types before running:\n// if a filter uses timestamp(x) / time / json literals, wrap them in CAST to a standard type","typeGuard":"private static boolean isPushdownSafeType(Type type) {\n    String n = type.getDisplayName();\n    return n.startsWith(\"varchar\") || n.startsWith(\"bigint\") || n.startsWith(\"integer\")\n        || n.startsWith(\"double\") || n.startsWith(\"boolean\") || n.startsWith(\"date\")\n        || n.matches(\"timestamp\\\\(\\\\d+\\\\)\");\n}","tryCatchPattern":"try {\n    connector.executeSelect(...);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.toErrorCode().getCode()) {\n        // rewrite the query with CAST on the predicate literal and retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["CAST predicate literals to simple types (varchar, bigint, timestamp) when filtering JDBC tables","Upgrade the remote database's JDBC driver","Avoid comparing against Presto-specific types (json, arrays) in WHERE clauses on JDBC catalogs","If you control the connector, disable pushdown for problematic types or add a TypeHandler"],"tags":["jdbc","not-supported","type-mapping","pushdown"],"backgroundTag":"unsupported-column-type","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}