{"record":{"id":"60475e25335b285b","repo":"prestodb/presto","slug":"getrow","errorCode":null,"errorMessage":"getRow","messagePattern":"getRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":671,"sourceCode":"    @Override\n    public boolean first()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"first\");\n    }\n\n    @Override\n    public boolean last()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"last\");\n    }\n\n    @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()","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L653-L689","documentation":"PrestoResultSet throws SQLFeatureNotSupportedException(\"getRow\") because row positioning is meaningless in a forward-only streaming result set; the driver never tracks a 1-based absolute row number for the caller.","triggerScenarios":"Calling ResultSet.getRow() on a PrestoResultSet at any point during iteration.","commonSituations":"Progress reporting or pagination code that uses getRow() to track the current row number while fetching; row-count idiom rs.last(); rs.getRow().","solutions":["Maintain your own counter incremented in each rs.next() loop iteration","Use SELECT COUNT(*) for total row counts instead of last()+getRow()","Expose the row index from your own iteration wrapper class"],"exampleFix":"// before\nwhile (rs.next()) { process(rs.getRow(), rs); }\n// after\nint row = 0;\nwhile (rs.next()) { row++; process(row, rs); }","handlingStrategy":"try-catch","validationCode":"// Track row number yourself before calling getRow()\nint rowNum = 0;\nwhile (rs.next()) { rowNum++; }","typeGuard":null,"tryCatchPattern":"try { int n = rs.getRow(); } catch (SQLFeatureNotSupportedException e) { /* use own counter */ }","preventionTips":["Maintain an explicit loop counter during iteration","Never rely on driver-tracked row numbers with Presto","Avoid scrollable-positioning APIs entirely"],"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"}