{"record":{"id":"f2266af25b48b43d","repo":"prestodb/presto","slug":"not-supported-f2266a","errorCode":"NOT_SUPPORTED","errorMessage":"No indexed columns in table metadata. Refusing to index a table with no indexed columns","messagePattern":"No indexed columns in table metadata\\. Refusing to index a table with no indexed columns","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java","lineNumber":179,"sourceCode":"                indexColumnsBuilder.put(family, qualifier);\n\n                // Create a mapping for this column's Presto type, again creating a new one for the\n                // family if necessary\n                Map<ByteBuffer, Type> types = indexColumnTypesBuilder.get(family);\n                if (types == null) {\n                    types = new HashMap<>();\n                    indexColumnTypesBuilder.put(family, types);\n                }\n                types.put(qualifier, columnHandle.getType());\n            }\n        });\n\n        indexColumns = indexColumnsBuilder.build();\n        indexColumnTypes = ImmutableMap.copyOf(indexColumnTypesBuilder);\n\n        // If there are no indexed columns, throw an exception\n        if (indexColumns.isEmpty()) {\n            throw new PrestoException(NOT_SUPPORTED, \"No indexed columns in table metadata. Refusing to index a table with no indexed columns\");\n        }\n\n        // Initialize metrics map\n        // This metrics map is for column cardinality\n        metrics.put(METRICS_TABLE_ROW_COUNT, new AtomicLong(0));\n\n        // Scan the metrics table for existing first row and last row\n        Pair<byte[], byte[]> minmax = getMinMaxRowIds(connector, table, auths);\n        firstRow = minmax.getLeft();\n        lastRow = minmax.getRight();\n    }\n\n    /**\n     * Index the given mutation, adding mutations to the index and metrics table\n     * <p>\n     * Like typical use of a BatchWriter, this method does not flush mutations to the underlying index table.\n     * 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.\n     *","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java#L161-L197","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Recreate or alter the table so it declares indexed columns, e.g. CREATE TABLE ... WITH (indexed_columns = ARRAY['col'])","Verify the connector's metadata table has the index-columns entry for this table and restore it if missing","If the table genuinely needs no index, use the non-indexed path instead of enabling indexing"],"exampleFix":"// before\nCREATE TABLE t (a VARCHAR, b VARCHAR) WITH (external=true); -- no indexed columns\n// after\nCREATE TABLE t (a VARCHAR, b VARCHAR) WITH (external=true, indexed_columns=ARRAY['a']);","handlingStrategy":"validation","validationCode":"// before enabling indexing, confirm the table declares indexed columns\nList<String> idx = (List<String>) tableProperties.getOrDefault(\"indexed_columns\", Collections.emptyList());\nif (idx.isEmpty()) { throw new IllegalStateException(\"Declare WITH (indexed_columns=[...]) before indexing\"); }","typeGuard":"static boolean hasIndexedColumns(Map<String, Object> tableProperties) {\n    Object cols = tableProperties.get(\"indexed_columns\");\n    return cols instanceof Collection<?> && !((Collection<?>) cols).isEmpty();\n}","tryCatchPattern":"try {\n    new Indexer(conn, schema, table, indexColumns, colTypes, writer, metrics);\n} catch (PrestoException e) {\n    if (e.getErrorCode().toErrorCode().getName().equals(\"NOT_SUPPORTED\")) {\n        logger.error(\"Table has no indexed columns; fix table properties\");\n    }\n    throw e;\n}","preventionTips":["Always specify WITH (indexed_columns=[...]) when creating tables you intend to index","Validate the metadata table's index-columns row after schema registration or connector upgrades","Document that external tables need at least one indexed column for indexing","Use DDL templates that enforce indexed_columns for indexed tables"],"tags":["accumulo","presto","metadata","configuration"],"backgroundTag":"missing-index-configuration","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}