prestodb/presto · error · SQLFeatureNotSupportedException

absolute

Error message

absolute

What it means

PrestoResultSet throws SQLFeatureNotSupportedException("absolute") because the result set is forward-only; absolute positioning to an arbitrary row number requires a scrollable, buffered result set which the Presto JDBC driver does not provide.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:678

    @Override
    public boolean last()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("last");
    }

    @Override
    public int getRow()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("getRow");
    }

    @Override
    public boolean absolute(int row)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("absolute");
    }

    @Override
    public boolean relative(int rows)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("relative");
    }

    @Override
    public boolean previous()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("previous");
    }

    @Override
    public void setFetchDirection(int direction)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use SQL-level pagination: ORDER BY ... LIMIT n OFFSET m in the query
  2. Re-execute the query and skip rows forward with next() until reaching the target
  3. Maintain a running row counter and stop at the desired row during a forward pass

Example fix

// before
rs.absolute(pageSize * pageNum + 1);
// after
String paged = sql + " LIMIT " + pageSize + " OFFSET " + (pageSize * pageNum);
rs = stmt.executeQuery(paged);
Defensive patterns

Strategy: try-catch

Validate before calling

DatabaseMetaData md = conn.getMetaData();
if (!md.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE)) { /* use LIMIT/OFFSET instead */ }

Try / catch

try { rs.absolute(offset); } catch (SQLFeatureNotSupportedException e) { /* re-query with LIMIT/OFFSET */ }

Prevention

When it happens

Trigger: Calling ResultSet.absolute(int row) on a PrestoResultSet to jump to a specific row.

Common situations: Pagination frameworks that seek to a page offset via absolute(offset) rather than using LIMIT/OFFSET in SQL.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/e530798c7d048ead. Report an issue: GitHub.