prestodb/presto · warning · SQLFeatureNotSupportedException

indexes not supported

Error message

indexes not supported

What it means

getIndexInfo() in PrestoDatabaseMetaData throws SQLFeatureNotSupportedException ('indexes not supported'). Presto's connector model does not expose secondary index metadata through the JDBC driver, so the method is an unimplemented interface stub.

Source

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

    @Override
    public ResultSet getTypeInfo()
            throws SQLException
    {
        return select("" +
                "SELECT TYPE_NAME, DATA_TYPE, PRECISION, LITERAL_PREFIX, LITERAL_SUFFIX,\n" +
                "CREATE_PARAMS, NULLABLE, CASE_SENSITIVE, SEARCHABLE, UNSIGNED_ATTRIBUTE,\n" +
                "FIXED_PREC_SCALE, AUTO_INCREMENT, LOCAL_TYPE_NAME, MINIMUM_SCALE, MAXIMUM_SCALE,\n" +
                "SQL_DATA_TYPE, SQL_DATETIME_SUB, NUM_PREC_RADIX\n" +
                "FROM system.jdbc.types\n" +
                "ORDER BY DATA_TYPE");
    }

    @Override
    public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("indexes not supported");
    }

    @Override
    public boolean supportsResultSetType(int type)
            throws SQLException
    {
        return type == ResultSet.TYPE_FORWARD_ONLY;
    }

    @Override
    public boolean supportsResultSetConcurrency(int type, int concurrency)
            throws SQLException
    {
        return (type == ResultSet.TYPE_FORWARD_ONLY) &&
                (concurrency == ResultSet.CONCUR_READ_ONLY);
    }

    @Override

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Assume no secondary indexes on Presto tables and skip getIndexInfo calls
  2. Catch SQLFeatureNotSupportedException and treat as empty index list
  3. Rely on connector-specific partitioning/sorting knowledge instead of index metadata
  4. Track upstream implementation if index metadata support is added

Example fix

// before
ResultSet idx = meta.getIndexInfo(catalog, schema, table, false, false);
// after
ResultSet idx;
try {
    idx = meta.getIndexInfo(catalog, schema, table, false, false);
} catch (SQLFeatureNotSupportedException e) {
    idx = EMPTY_RESULT_SET;
}
Defensive patterns

Strategy: try-catch

Validate before calling

boolean supportsIndexInfo = !(meta instanceof com.facebook.presto.jdbc.PrestoDatabaseMetaData);

Type guard

boolean supportsIndexInfo = !(meta instanceof com.facebook.presto.jdbc.PrestoDatabaseMetaData);

Try / catch

try (ResultSet rs = meta.getIndexInfo(cat, schema, table, false, false)) { ... } catch (SQLFeatureNotSupportedException e) { /* no indexes */ }

Prevention

When it happens

Trigger: Calling DatabaseMetaData.getIndexInfo(catalog, schema, table, unique, approximate) on a Presto connection, often during query-plan or schema analysis by tools.

Common situations: Query optimizers/SQL formatters inspecting indexes, performance-analysis tools, ORMs generating index-aware DDL against Presto.

Related errors


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