prestodb/presto · error · SQLFeatureNotSupportedException

getGeneratedKeys

Error message

getGeneratedKeys

What it means

getGeneratedKeys in PrestoStatement always throws SQLFeatureNotSupportedException after checkOpen(): the Presto engine does not return auto-generated keys, so this JDBC feature is unimplemented regardless of the executed statement.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:475

        currentUpdateType.set(null);

        if (current == CLOSE_CURRENT_RESULT) {
            closeResultSet();
            return false;
        }

        if (current != KEEP_CURRENT_RESULT && current != CLOSE_ALL_RESULTS) {
            throw new SQLException("Invalid argument: " + current);
        }

        throw new SQLFeatureNotSupportedException("Multiple open results not supported");
    }

    @Override
    public ResultSet getGeneratedKeys()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("getGeneratedKeys");
    }

    @Override
    public int executeUpdate(String sql)
            throws SQLException
    {
        return Ints.saturatedCast(executeLargeUpdate(sql));
    }

    @Override
    public int executeUpdate(String sql, int autoGeneratedKeys)
            throws SQLException
    {
        return executeUpdate(sql);
    }

    @Override
    public int executeUpdate(String sql, int[] columnIndexes)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Generate identifiers client-side (e.g. UUIDs) before inserting
  2. Retrieve assigned keys via a follow-up SELECT (query the table's metadata/last value)
  3. Catch SQLFeatureNotSupportedException in generic key-retrieval code paths
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:475 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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