{"record":{"id":"a5c5a52171791bc6","repo":"prestodb/presto","slug":"getunicodestream","errorCode":null,"errorMessage":"getUnicodeStream","messagePattern":"getUnicodeStream","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":360,"sourceCode":"                throw new SQLException(\"Invalid timestamp from server: \" + value, e);\n            }\n        }\n\n        throw new IllegalArgumentException(\"Expected column to be a timestamp type but is \" + columnInfo.getColumnTypeName());\n    }\n\n    @Override\n    public InputStream getAsciiStream(int columnIndex)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"ResultSet\", \"getAsciiStream\");\n    }\n\n    @Override\n    public InputStream getUnicodeStream(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getUnicodeStream\");\n    }\n\n    @Override\n    public InputStream getBinaryStream(int columnIndex)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"ResultSet\", \"getBinaryStream\");\n    }\n\n    @Override\n    public String getString(String columnLabel)\n            throws SQLException\n    {\n        Object value = column(columnLabel);\n        return (value != null) ? value.toString() : null;\n    }\n\n    @Override","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L342-L378","documentation":"getUnicodeStream in PrestoResultSet always throws SQLFeatureNotSupportedException: the deprecated JDBC Unicode character stream retrieval API is not implemented by the Presto driver, regardless of the column index requested.","triggerScenarios":"Calling rs.getUnicodeStream(columnIndex) on any PrestoResultSet, with any column index, at any time.","commonSituations":"Legacy JDBC code migrated from old databases that used getUnicodeStream; generated code or wrappers still emitting the deprecated stream getters.","solutions":["Replace with rs.getString(columnIndex), which returns decoded UTF-8 text","If a stream is required, wrap the String bytes: new ByteArrayInputStream(rs.getString(i).getBytes(StandardCharsets.UTF_8))","Retire the deprecated call site; the method is feature-unsupported by design"],"exampleFix":"// before\nReader r = new InputStreamReader(rs.getUnicodeStream(1), StandardCharsets.UTF_8);\n// after\nString s = rs.getString(1);\nReader r = s != null ? new StringReader(s) : null;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Reader r;\ntry {\n    r = new InputStreamReader(rs.getUnicodeStream(idx), StandardCharsets.UTF_8);\n} catch (SQLFeatureNotSupportedException e) {\n    String s = rs.getString(idx);\n    r = s != null ? new StringReader(s) : null;\n}","preventionTips":["getUnicodeStream is deprecated in JDBC; use getString or getCharacterStream","Treat Presto text columns as Strings, not streams","Audit migrated legacy code for getUnicodeStream calls","Prefer modern JDBC APIs supported by the driver"],"tags":["jdbc","presto","unsupported-operation","deprecated-api"],"backgroundTag":"jdbc-unsupported-operation","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"}