apache/cassandra · error · InvalidRequestException
Only CUSTOM indexes support multiple columns
Error message
Only CUSTOM indexes support multiple columns
What it means
Thrown while applying CREATE INDEX when more than one index target column is supplied (indexTargets.size() > 1) but the index is not a CUSTOM index. Only custom index implementations may span multiple columns; built-in index types are limited to a single target column, so the multi-column target list is rejected.
Solutions
- Create one index per column, or declare the index as CUSTOM with an implementation that supports multiple targets.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:196 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/7579e87714361099.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:196
throw new InvalidRequestException(TRANSIENTLY_REPLICATED_KEYSPACE_NOT_SUPPORTED);
// guardrails to limit number of secondary indexes per table.
Guardrails.secondaryIndexesPerTable.guard(table.indexes.size() + 1,
Strings.isNullOrEmpty(indexName)
? String.format("on table %s", table.name)
: String.format("%s on table %s", indexName, table.name),
false,
state);
List<IndexTarget> indexTargets = Lists.newArrayList(transform(rawIndexTargets, t -> t.prepare(table)));
if (indexTargets.isEmpty() && !attrs.isCustom)
throw ire(CUSTOM_CREATE_WITHOUT_COLUMN);
if (indexTargets.size() > 1)
{
if (!attrs.isCustom)
throw ire(CUSTOM_MULTIPLE_COLUMNS);
Set<ColumnIdentifier> columns = new HashSet<>();
for (IndexTarget target : indexTargets)
if (!columns.add(target.column))
throw ire(DUPLICATE_TARGET_COLUMN, target.column);
}
IndexMetadata.Kind kind = attrs.isCustom ? IndexMetadata.Kind.CUSTOM : IndexMetadata.Kind.COMPOSITES;
indexTargets.forEach(t -> validateIndexTarget(table, kind, t, attrs));
String name = null == indexName ? generateIndexName(keyspace, indexTargets) : indexName;
Map<String, String> options = attrs.isCustom ? attrs.getOptions() : Collections.emptyMap();
IndexMetadata index = IndexMetadata.fromIndexTargets(indexTargets, name, kind, options);
// check to disallow creation of an index which duplicates an existing one in all but nameView on GitHub (pinned to 88fd0f6a0e)