{"record":{"id":"06e84fc66fd12d7f","repo":"apache/shardingsphere","slug":"getcharacterstream","errorCode":null,"errorMessage":"getCharacterStream","messagePattern":"getCharacterStream","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":69,"sourceCode":"    \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":51,"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#L51-L77","documentation":"LocalDataMergedResult.getCharacterStream(columnIndex) always throws SQLFeatureNotSupportedException('getCharacterStream'). Local data merge handles rows assembled inside ShardingSphere (metadata/SHOW results) that contain plain cell values with no underlying Reader source, so character-stream access is deliberately unimplemented.","triggerScenarios":"Calling rs.getCharacterStream(i) or rs.getNCharacterStream(i) on a ResultSet produced by a locally merged statement (SHOW DATABASES, SHOW SHARDING TABLE RULES, metadata queries) routed through LocalDataMergedResult.","commonSituations":"Reporting tools that read all text columns as Readers; JDBC helper libraries choosing getCharacterStream for LONGVARCHAR-type columns; code paths shared between driver-backed queries and locally generated result sets.","solutions":["Use rs.getString(i) for character data on locally merged results.","Gate stream access on the statement kind — reserve getCharacterStream for real table queries served by driver-backed merge results.","Catch SQLFeatureNotSupportedException and fall back to getString."],"exampleFix":"// before\nReader r = resultSet.getCharacterStream(1);\n\n// after\nString value = resultSet.getString(1);","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try (Reader r = rs.getCharacterStream(i)) { ... } catch (SQLFeatureNotSupportedException e) { String s = rs.getString(i); ... }","preventionTips":["Read locally merged results with getString.","Make data-access helpers type-aware instead of always using Readers."],"tags":["jdbc","merge","character-stream","show-statements"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}