{"record":{"id":"b61f3d42b9247d5a","repo":"apache/shardingsphere","slug":"absolute-b61f3d","errorCode":null,"errorMessage":"absolute","messagePattern":"absolute","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java","lineNumber":80,"sourceCode":"    \n    @Override\n    public void afterLast() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"afterLast\");\n    }\n    \n    @Override\n    public boolean first() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"first\");\n    }\n    \n    @Override\n    public boolean last() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"last\");\n    }\n    \n    @Override\n    public boolean absolute(final int row) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"absolute\");\n    }\n    \n    @Override\n    public boolean relative(final int rows) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"relative\");\n    }\n    \n    @Override\n    public int getRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getRow\");\n    }\n    \n    @Override\n    public final void insertRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"insertRow\");\n    }\n    \n    @Override","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java#L62-L98","documentation":"absolute(int row) is unimplemented in the federation ResultSet: AbstractUnsupportedOperationSQLFederationResultSet throws SQLFeatureNotSupportedException for all absolute positioning because the underlying federation result is a one-pass stream. Unlike drivers that emulate absolute() by repeated next(), no emulation exists here.","triggerScenarios":"Calling rs.absolute(n) on the result of a federated SELECT — most often hard-coded pagination (rs.absolute(pageSize*(page-1)+1)) or jumping to a known row index in report rendering code.","commonSituations":"Hand-rolled LIMIT/OFFSET pagination implemented via absolute(); DBUtils/DataTable components that position by row index; moving an existing application behind ShardingSphere federation without auditing ResultSet scrolling usage.","solutions":["Push pagination into SQL: append LIMIT/OFFSET (MySQL/PostgreSQL/OpenGauss dialects) to the federated query instead of absolute() positioning","Compute the target row while iterating forward with next() and a row counter if the offset is small","For random access, materialize rows into a List and index it in application code"],"exampleFix":"// before\nrs.absolute(41); // jump to row 41\n\n// after\nResultSet rs = stmt.executeQuery(\"SELECT ... ORDER BY id LIMIT 20 OFFSET 40\");\nrs.next();","handlingStrategy":"validation","validationCode":"if (rs.getType() == ResultSet.TYPE_FORWARD_ONLY) {\n    // absolute(n) unsupported: use SQL OFFSET/LIMIT pagination\n}","typeGuard":"private boolean supportsAbsolute(final ResultSet rs) throws SQLException {\n    return rs.getType() != ResultSet.TYPE_FORWARD_ONLY;\n}","tryCatchPattern":"try {\n    rs.absolute(offset + 1);\n} catch (final SQLFeatureNotSupportedException e) {\n    throw new IllegalStateException(\"use LIMIT/OFFSET pagination for federation result sets\", e);\n}","preventionTips":["Push pagination into SQL (LIMIT/OFFSET) instead of cursor jumping","Audit for rs.absolute in pagination helpers before federation rollout","Counter-based forward loops for small skips"],"tags":["jdbc","resultset","sql-federation","pagination","cursor","shardingsphere"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}