prestodb/presto · warning · SQLFeatureNotSupportedException

row identifiers not supported

Error message

row identifiers not supported

What it means

PrestoDatabaseMetaData.getBestRowIdentifier() unconditionally throws SQLFeatureNotSupportedException. This DatabaseMetaData method reports a minimal set of columns that uniquely identify a row, which presumes primary-key-like semantics Presto tables do not have. The driver rejects it instead of returning a fabricated result.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDatabaseMetaData.java:1007

    @Override
    public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("privileges not supported");
    }

    @Override
    public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("privileges not supported");
    }

    @Override
    public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("row identifiers not supported");
    }

    @Override
    public ResultSet getVersionColumns(String catalog, String schema, String table)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("version columns not supported");
    }

    @Override
    public ResultSet getPrimaryKeys(String catalog, String schema, String table)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("primary keys not supported");
    }

    @Override
    public ResultSet getImportedKeys(String catalog, String schema, String table)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Catch SQLFeatureNotSupportedException and treat the table as having no row identifier
  2. Use known business keys / partition columns from your own schema knowledge
  3. Do not attempt keyset-based updates against Presto via JDBC metadata
Defensive patterns

Strategy: try-catch

Validate before calling

if (md.getDatabaseProductName().contains("Presto")) {
    return null; // no row identifier available
}

Try / catch

try (ResultSet rs = md.getBestRowIdentifier(catalog, schema, table, scope, nullable)) {
    return readIdentifier(rs);
} catch (SQLFeatureNotSupportedException e) {
    return null;
}

Prevention

When it happens

Trigger: Calling DatabaseMetaData.getBestRowIdentifier(catalog, schema, table, scope, nullable); updatable-row tooling that needs a row identifier to build keyset-based updates.

Common situations: ORMs or data-sync tools locating rows for optimistic locking; GUIs that call it to render key columns; generic JDBC frameworks probing identifier columns before updates.

Related errors


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