{"record":{"id":"1a2fe58b486dfb65","repo":"prestodb/presto","slug":"getblob","errorCode":null,"errorMessage":"getBlob","messagePattern":"getBlob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1109,"sourceCode":"    @Override\n    public Object getObject(int columnIndex, Map<String, Class<?>> map)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getObject\");\n    }\n\n    @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","sourceCodeStart":1091,"sourceCodeEnd":1127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1091-L1127","documentation":"getBlob(int) returns a java.sql.Blob locator for binary large object data. Presto's PrestoResultSet does not support BLOB locators and always throws SQLFeatureNotSupportedException(\"getBlob\"). Use getBytes()/getBinaryStream()/getBinaryObject for binary data instead.","triggerScenarios":"Calling rs.getBlob(columnIndex) or getBlob(columnLabel) on a PrestoResultSet for a VARBINARY column.","commonSituations":"Code ported from MySQL/PostgreSQL drivers that store files in BLOB columns; document/image handling code assuming java.sql.Blob; ORMs mapping BLOB columns.","solutions":["Use rs.getBytes(columnIndex) to read the VARBINARY value directly, or getBinaryStream(columnIndex) for streaming","Change the code path to work with byte[] instead of java.sql.Blob","Check the column type via ResultSetMetaData and branch to the Presto-supported accessor"],"exampleFix":"// before\nBlob blob = rs.getBlob(\"payload\");\nbyte[] data = blob.getBytes(1, (int) blob.length());\n// after\nbyte[] data = rs.getBytes(\"payload\");\n// or stream:\ntry (InputStream in = rs.getBinaryStream(\"payload\")) { ... }","handlingStrategy":"fallback","validationCode":"int type = rs.getMetaData().getColumnType(col);\nif (type == java.sql.Types.VARBINARY || type == java.sql.Types.BINARY) {\n    byte[] data = rs.getBytes(col); // instead of rs.getBlob(col)\n}","typeGuard":"static boolean isBinaryColumn(ResultSetMetaData md, int col) throws SQLException {\n    int t = md.getColumnType(col);\n    return t == Types.VARBINARY || t == Types.BINARY || t == Types.LONGVARBINARY;\n}","tryCatchPattern":"try {\n    return rs.getBlob(col);\n} catch (SQLFeatureNotSupportedException e) {\n    byte[] bytes = rs.getBytes(col);\n    return bytes == null ? null : new javax.sql.rowset.serial.SerialBlob(bytes);\n}","preventionTips":["Use getBytes()/getBinaryStream() for Presto VARBINARY columns","Avoid java.sql.Blob/Clob APIs with Presto","Check ResultSetMetaData column types before choosing an accessor"],"tags":["jdbc","presto","unsupported-feature","blob","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"}