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
- Catch SQLFeatureNotSupportedException and treat the table as having no row identifier
- Use known business keys / partition columns from your own schema knowledge
- 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
- Do not build updatable-cursor/keyset logic on JDBC metadata for Presto
- Track business keys in your own schema metadata
- Skip getBestRowIdentifier in generic metadata crawlers for Presto
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
- privileges not supported
- version columns not supported
- primary keys not supported
- Result set type must be TYPE_FORWARD_ONLY
- Result set concurrency must be CONCUR_READ_ONLY
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/4be217f73b00a2bf.
Report an issue: GitHub.