prestodb/presto · error

NOT_SUPPORTED

NOT_SUPPORTED

Error message

No indexed columns in table metadata. Refusing to index a table with no indexed columns

What it means

PrestoException with code NOT_SUPPORTED thrown from the Indexer constructor when the table's metadata contains zero indexed columns. The Accumulo connector's Indexer exists solely to maintain secondary-index entries; building one for a table with no indexed columns would be useless, so it refuses up front.

Source

Thrown at presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java:179

                indexColumnsBuilder.put(family, qualifier);

                // Create a mapping for this column's Presto type, again creating a new one for the
                // family if necessary
                Map<ByteBuffer, Type> types = indexColumnTypesBuilder.get(family);
                if (types == null) {
                    types = new HashMap<>();
                    indexColumnTypesBuilder.put(family, types);
                }
                types.put(qualifier, columnHandle.getType());
            }
        });

        indexColumns = indexColumnsBuilder.build();
        indexColumnTypes = ImmutableMap.copyOf(indexColumnTypesBuilder);

        // If there are no indexed columns, throw an exception
        if (indexColumns.isEmpty()) {
            throw new PrestoException(NOT_SUPPORTED, "No indexed columns in table metadata. Refusing to index a table with no indexed columns");
        }

        // Initialize metrics map
        // This metrics map is for column cardinality
        metrics.put(METRICS_TABLE_ROW_COUNT, new AtomicLong(0));

        // Scan the metrics table for existing first row and last row
        Pair<byte[], byte[]> minmax = getMinMaxRowIds(connector, table, auths);
        firstRow = minmax.getLeft();
        lastRow = minmax.getRight();
    }

    /**
     * Index the given mutation, adding mutations to the index and metrics table
     * <p>
     * Like typical use of a BatchWriter, this method does not flush mutations to the underlying index table.
     * For higher throughput the modifications to the metrics table are tracked in memory and added to the metrics table when the indexer is flushed or closed.
     *

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Recreate or alter the table so it declares indexed columns, e.g. CREATE TABLE ... WITH (indexed_columns = ARRAY['col'])
  2. Verify the connector's metadata table has the index-columns entry for this table and restore it if missing
  3. If the table genuinely needs no index, use the non-indexed path instead of enabling indexing

Example fix

// before
CREATE TABLE t (a VARCHAR, b VARCHAR) WITH (external=true); -- no indexed columns
// after
CREATE TABLE t (a VARCHAR, b VARCHAR) WITH (external=true, indexed_columns=ARRAY['a']);
Defensive patterns

Strategy: validation

Validate before calling

// before enabling indexing, confirm the table declares indexed columns
List<String> idx = (List<String>) tableProperties.getOrDefault("indexed_columns", Collections.emptyList());
if (idx.isEmpty()) { throw new IllegalStateException("Declare WITH (indexed_columns=[...]) before indexing"); }

Type guard

static boolean hasIndexedColumns(Map<String, Object> tableProperties) {
    Object cols = tableProperties.get("indexed_columns");
    return cols instanceof Collection<?> && !((Collection<?>) cols).isEmpty();
}

Try / catch

try {
    new Indexer(conn, schema, table, indexColumns, colTypes, writer, metrics);
} catch (PrestoException e) {
    if (e.getErrorCode().toErrorCode().getName().equals("NOT_SUPPORTED")) {
        logger.error("Table has no indexed columns; fix table properties");
    }
    throw e;
}

Prevention

When it happens

Trigger: Instantiating Indexer during indexing/ingest of an Accumulo-backed table whose metadata defines no indexed columns (no accumulo.index_columns table property, or a missing/corrupt metadata row).

Common situations: Table created without WITH indexed_columns property; the connector's metadata table row for the table lost or hand-edited; connector version changes altering how index columns are serialized; copying a table without its properties.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


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