{"record":{"id":"a3cbad70798b1bbc","repo":"prestodb/presto","slug":"relative","errorCode":null,"errorMessage":"relative","messagePattern":"relative","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":685,"sourceCode":"    @Override\n    public int getRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getRow\");\n    }\n\n    @Override\n    public boolean absolute(int row)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"absolute\");\n    }\n\n    @Override\n    public boolean relative(int rows)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"relative\");\n    }\n\n    @Override\n    public boolean previous()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"previous\");\n    }\n\n    @Override\n    public void setFetchDirection(int direction)\n            throws SQLException\n    {\n        checkOpen();\n        if (direction != FETCH_FORWARD) {\n            throw new SQLException(\"Fetch direction must be FETCH_FORWARD\");\n        }\n    }","sourceCodeStart":667,"sourceCodeEnd":703,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L667-L703","documentation":"PrestoResultSet throws SQLFeatureNotSupportedException(\"relative\") because the driver supports only forward-only iteration; moving a relative number of rows (forward or backward) from the current position is not supported without buffering.","triggerScenarios":"Calling ResultSet.relative(int rows) on a PrestoResultSet, including relative(0) to refresh the current row.","commonSituations":"Code ported from scrollable-result-set databases that steps N rows at a time or skips rows via relative().","solutions":["Skip forward rows with a plain loop over rs.next()","Include the skip in SQL with LIMIT/OFFSET or a window function","Re-execute the query if backward movement is required"],"exampleFix":"// before\nrs.relative(10);\n// after\nfor (int i = 0; i < 10 && rs.next(); i++) { /* skip */ }","handlingStrategy":"try-catch","validationCode":"DatabaseMetaData md = conn.getMetaData();\nif (!md.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE)) { /* skip rows with next() */ }","typeGuard":null,"tryCatchPattern":"try { rs.relative(n); } catch (SQLFeatureNotSupportedException e) { /* loop rs.next() n times */ }","preventionTips":["Skip forward rows with an explicit next() loop","Never move backward; re-run the query instead","Prefer SQL-side offset/skip logic"],"tags":["jdbc","unsupported-operation","forward-only-resultset"],"backgroundTag":"jdbc-resultset-navigation-unsupported","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"}