{"record":{"id":"849212a85f1f3f8c","repo":"apache/shardingsphere","slug":"getinputstream","errorCode":null,"errorMessage":"getInputStream","messagePattern":"getInputStream","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/local/LocalDataMergedResult.java","lineNumber":64,"sourceCode":"            currentRow = rows.next();\n            return true;\n        }\n        return false;\n    }\n    \n    @Override\n    public Object getValue(final int columnIndex, final Class<?> type) {\n        return currentRow.getCell(columnIndex);\n    }\n    \n    @Override\n    public Object getCalendarValue(final int columnIndex, final Class<?> type, @SuppressWarnings(\"UseOfObsoleteDateTimeApi\") final Calendar calendar) {\n        return currentRow.getCell(columnIndex);\n    }\n    \n    @Override\n    public InputStream getInputStream(final int columnIndex, final String type) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getInputStream\");\n    }\n    \n    @Override\n    public Reader getCharacterStream(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getCharacterStream\");\n    }\n    \n    @Override\n    public boolean wasNull() {\n        return null == currentRow;\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/local/LocalDataMergedResult.java#L46-L77","documentation":"LocalDataMergedResult merges locally produced rows (e.g. results for SHOW/metadata-style statements built inside ShardingSphere). Its getInputStream(columnIndex, type) has no meaningful implementation because local rows hold plain cell values, not streamable LOB sources, so it always throws SQLFeatureNotSupportedException('getInputStream').","triggerScenarios":"Application or framework code calling rs.getBinaryStream(i) (which routes to getInputStream with a binary type) on a ResultSet whose merge result is LocalDataMergedResult — typically results of SHOW statements, metadata queries, or other locally generated result sets.","commonSituations":"Generic ORM/streaming helpers that unconditionally use getBinaryStream for BLOB-ish columns; the same code path working against driver-backed merge results but failing for locally merged SHOW results; tests replaying SHOW queries through the proxy with stream-based readers.","solutions":["Use rs.getString(i) or rs.getObject(i) for locally merged results instead of stream access.","Branch on statement type: only use stream access for SELECTs against real tables that go through driver-backed results.","Catch SQLFeatureNotSupportedException and fall back to getObject for these result sets."],"exampleFix":"// before\nInputStream in = resultSet.getBinaryStream(2);\n\n// after\nObject cell = resultSet.getObject(2);\nbyte[] bytes = cell instanceof byte[] ? (byte[]) cell : String.valueOf(cell).getBytes(StandardCharsets.UTF_8);","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try (InputStream in = rs.getBinaryStream(i)) { ... } catch (SQLFeatureNotSupportedException e) { byte[] b = rs.getBytes(i); ... }","preventionTips":["Use getString/getObject for SHOW and metadata result sets.","Reserve stream APIs for queries backed by real driver result sets."],"tags":["jdbc","merge","stream","show-statements"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}