apache/cassandra · error · InvalidRequestException
Column ' ' contains non-alphanumeric-underscore characters
Error message
Column '%s' contains non-alphanumeric-underscore characters
What it means
CreateIndexStatement.validateCustomIndexColumnName: the explicit column name given for a custom index target contains characters outside the allowed alphanumeric/underscore set, which custom index target naming requires.
Solutions
- Rename the column or quote a valid identifier containing only alphanumerics and underscores.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:245 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/19a041a568163a73.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:245
TableMetadata newTable = table.withSwapped(table.indexes.with(index));
newTable.validate();
return schema.withAddedOrUpdated(keyspace.withSwapped(keyspace.tables.withSwapped(newTable)));
}
@Override
Set<String> clientWarnings(KeyspacesDiff diff)
{
if (attrs.isCustom && attrs.customClass.equals(SASIIndex.class.getName()))
return ImmutableSet.of(SASIIndex.USAGE_WARNING);
return ImmutableSet.of();
}
private void validateCustomIndexColumnName(String name)
{
if (!SchemaConstants.isValidCharsName(name))
throw ire(INVALID_CHARS_CUSTOM_INDEX_TARGET, name);
if (name.length() > SchemaConstants.NAME_LENGTH)
throw ire(TOO_LONG_CUSTOM_INDEX_TARGET, name, SchemaConstants.NAME_LENGTH);
}
private void validateIndexTarget(TableMetadata table, IndexMetadata.Kind kind, IndexTarget target, IndexAttributes attrs)
{
ColumnMetadata column = table.getColumn(target.column);
if (null == column)
throw ire(COLUMN_DOES_NOT_EXIST, target.column);
AbstractType<?> baseType = column.type.unwrap();
boolean isNonSAIIndex = !isSAIIndex(attrs);
// TODO: this check needs to be removed with CASSANDRA-20235
if ((kind == IndexMetadata.Kind.CUSTOM))
validateCustomIndexColumnName(target.column.toString());View on GitHub (pinned to 88fd0f6a0e)