{"record":{"id":"0ff427eccc3ecf21","repo":"prestodb/presto","slug":"updateasciistream","errorCode":null,"errorMessage":"updateAsciiStream","messagePattern":"updateAsciiStream","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":872,"sourceCode":"    @Override\n    public void updateTime(int columnIndex, Time x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTime\");\n    }\n\n    @Override\n    public void updateTimestamp(int columnIndex, Timestamp x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTimestamp\");\n    }\n\n    @Override\n    public void updateAsciiStream(int columnIndex, InputStream x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateAsciiStream\");\n    }\n\n    @Override\n    public void updateBinaryStream(int columnIndex, InputStream x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBinaryStream\");\n    }\n\n    @Override\n    public void updateCharacterStream(int columnIndex, Reader x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateCharacterStream\");\n    }\n\n    @Override\n    public void updateObject(int columnIndex, Object x, int scaleOrLength)","sourceCodeStart":854,"sourceCodeEnd":890,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L854-L890","documentation":"PrestoResultSet.updateAsciiStream(int, InputStream, int) always throws SQLFeatureNotSupportedException(\"updateAsciiStream\"). The Presto JDBC driver implements read-only result sets; streaming update methods are interface-compliance stubs that reject use. Character stream data cannot be written into a row through the cursor.","triggerScenarios":"Calling updateAsciiStream(columnIndex, stream, length) (or the label/length variants) on a PrestoResultSet, typically to set a large VARCHAR column from a stream before updateRow().","commonSituations":"LOB-handling code ported from Oracle/MySQL JDBC usage; ingesting text files into a table row by row via cursor updates; persistence frameworks that stream large values into updatable result sets.","solutions":["Load the stream into a String or Reader in application code, then execute a parameterized UPDATE with setString/setCharacterStream semantics.","Use Presto's file/text ingestion (e.g. INSERT via Hive connector, or INSERT INTO ... SELECT from staged data) for bulk text loading.","Request CONCUR_READ_ONLY so no code path assumes updatable cursors.","Mark the Presto datasource read-only in framework configuration."],"exampleFix":"// before\nrs.updateAsciiStream(\"notes\", in, length);\nrs.updateRow();\n// after\nString text = new String(in.readAllBytes(), StandardCharsets.US_ASCII);\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE docs SET notes = ? WHERE id = ?\")) {\n    ps.setString(1, text);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {\n    // Presto: materialize stream and use UPDATE with setString instead of updateAsciiStream\n}","typeGuard":"boolean allowsStreamUpdate(ResultSet rs) {\n    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet);\n}","tryCatchPattern":"try {\n    rs.updateAsciiStream(\"notes\", in, length);\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // read the stream, then executeUpdate with setString\n}","preventionTips":["Never stream large text through ResultSet update methods with Presto; buffer then UPDATE.","Use Presto/Hive staging tables and INSERT INTO ... SELECT for bulk text ingestion.","Keep statements CONCUR_READ_ONLY.","Review LOB-handling libraries for updatable-result-set assumptions before pointing them at Presto."],"tags":["jdbc","sqlfeaturenotsupportedexception","read-only-resultset","presto"],"backgroundTag":"jdbc-updatable-resultset-not-supported","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"}