{"record":{"id":"ae51d836df40f2ef","repo":"prestodb/presto","slug":"getclob","errorCode":null,"errorMessage":"getClob","messagePattern":"getClob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1116,"sourceCode":"    @Override\n    public Ref getRef(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getRef\");\n    }\n\n    @Override\n    public Blob getBlob(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getBlob\");\n    }\n\n    @Override\n    public Clob getClob(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getClob\");\n    }\n\n    @Override\n    public Array getArray(int columnIndex)\n            throws SQLException\n    {\n        Object value = column(columnIndex);\n        if (value == null) {\n            return null;\n        }\n\n        ColumnInfo columnInfo = columnInfo(columnIndex);\n        String elementTypeName = getOnlyElement(columnInfo.getColumnTypeSignature().getParameters()).toString();\n        int elementType = getOnlyElement(columnInfo.getColumnParameterTypes());\n        return new PrestoArray(elementTypeName, elementType, (List<?>) value);\n    }\n\n    @Override","sourceCodeStart":1098,"sourceCodeEnd":1134,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1098-L1134","documentation":"Presto's JDBC driver does not implement Clob support. PrestoResultSet.getClob(int) unconditionally throws SQLFeatureNotSupportedException(\"getClob\"). Presto returns all values via the standard getString/getObject-style accessors; LOCATOR-based SQL types (CLOB/BLOB/REF/Array-as-SQL) are not part of the protocol.","triggerScenarios":"Calling rs.getClob(columnIndex) on any PrestoResultSet, regardless of column type or result contents.","commonSituations":"Porting code written for Oracle/PostgreSQL/MySQL drivers that read large text columns via getClob; generic ORM or BI tool code paths that default to Clob for long VARCHAR columns.","solutions":["Replace getClob with rs.getString(columnIndex) — Presto VARCHAR columns are fully readable as String","If using an abstraction layer, configure its Clob/mapping handler to fall back to getString","Check the column's actual type with ResultSetMetaData and branch accordingly"],"exampleFix":"// before\nClob clob = rs.getClob(1);\nString text = clob.getSubString(1, (int) clob.length());\n// after\nString text = rs.getString(1);","handlingStrategy":"try-catch","validationCode":"int type = rs.getMetaData().getColumnType(columnIndex);\nif (type == Types.CLOB) { /* Presto driver never returns this; read as VARCHAR */ }","typeGuard":null,"tryCatchPattern":"try {\n    return rs.getClob(columnIndex);\n} catch (SQLFeatureNotSupportedException e) {\n    return rs.getString(columnIndex);\n}","preventionTips":["Treat Presto JDBC as supporting only primitive getters (getString, getLong, getDouble, getBytes, getObject)","Check DatabaseMetaData/support docs before using LOCATOR-based getters","Centralize column-reading logic in one utility that avoids Clob/Blob/Ref APIs"],"tags":["jdbc","unsupported-feature","sqlfeaturenotsupported"],"backgroundTag":"unsupported-jdbc-feature","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"}