{"record":{"id":"88e4045251a49ad8","repo":"prestodb/presto","slug":"resultset","errorCode":null,"errorMessage":"ResultSet","messagePattern":"ResultSet","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":353,"sourceCode":"        }\n\n        if (columnInfo.getColumnTypeName().equalsIgnoreCase(\"timestamp with time zone\")) {\n            try {\n                return new Timestamp(TIMESTAMP_WITH_TIME_ZONE_FORMATTER.parseMillis(String.valueOf(value)));\n            }\n            catch (IllegalArgumentException e) {\n                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)","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L335-L371","documentation":"The legacy JDBC 1.0 getAsciiStream(int) method is not implemented in PrestoResultSet; it unconditionally throws NotImplementedException. The Presto JDBC driver never supports reading columns as ASCII streams.","triggerScenarios":"Calling rs.getAsciiStream(columnIndex) on any PrestoResultSet, with any column index, at any time.","commonSituations":"Porting generic JDBC code written for legacy drivers (e.g. old Oracle code) that reads text columns as streams; frameworks that fall back to stream-based getters.","solutions":["Replace getAsciiStream with rs.getString(columnIndex)","If a stream is needed, wrap the String: new ByteArrayInputStream(rs.getString(i).getBytes(StandardCharsets.US_ASCII))","Remove or stub the legacy stream-based code path when targeting Presto"],"exampleFix":"// before\nInputStream in = rs.getAsciiStream(1);\n// after\nString value = rs.getString(1);\nInputStream in = value != null ? new ByteArrayInputStream(value.getBytes(StandardCharsets.US_ASCII)) : null;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"InputStream in;\ntry {\n    in = rs.getAsciiStream(idx);\n} catch (NotImplementedException e) {\n    String s = rs.getString(idx);\n    in = s != null ? new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)) : null;\n}","preventionTips":["Never use legacy JDBC 1.0 stream getters (getAsciiStream/getUnicodeStream) with Presto","Use rs.getString for text columns","Grep your codebase for getAsciiStream and replace with getString","Centralize result-set access in a helper that only uses supported getters"],"tags":["jdbc","presto","unsupported-operation","not-implemented"],"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"}