apache/cassandra · error · ConfigurationException

%s does not support type %s

Error message

%s does not support type %s

What it means

Each SASI analyzer declares the column types it can handle via isCompatibleWith(AbstractType<?>). AbstractAnalyzer.validate compares the analyzer against the target column's type and throws this ConfigurationException when they are incompatible (e.g. a text analyzer on a numeric column).

Source

Thrown at src/java/org/apache/cassandra/index/sasi/analyzer/AbstractAnalyzer.java:46

public abstract class AbstractAnalyzer implements Iterator<ByteBuffer>
{
    protected ByteBuffer next = null;

    public ByteBuffer next()
    {
        return next;
    }

    public void remove()
    {
        throw new UnsupportedOperationException();
    }

    public void validate(Map<String, String> options, ColumnMetadata cm) throws ConfigurationException
    {
        if (!isCompatibleWith(cm.type))
            throw new ConfigurationException(String.format("%s does not support type %s",
                                                           this.getClass().getSimpleName(),
                                                           cm.type.asCQL3Type()));
    }

    public abstract void init(Map<String, String> options, AbstractType<?> validator);

    public abstract void reset(ByteBuffer input);

    /**
     * Test whether the given validator is compatible with the underlying analyzer.
     *
     * @param validator the validator to test the compatibility with
     * @return true if the give validator is compatible, false otherwise
     */
    protected abstract boolean isCompatibleWith(AbstractType<?> validator);

    /**
     * @return true if current analyzer provides text tokenization, false otherwise.

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove the analyzer options from the index on the non-text column (analyzers are for literal columns).
  2. If analysis is needed, ensure the target column is a text/ascii/varchar type.
  3. Choose an analyzer class whose isCompatibleWith accepts the column type, or fix a custom analyzer's isCompatibleWith implementation.

Example fix

// before (age is int)
WITH OPTIONS = {'target': 'age', 'mode': 'PREFIX', 'analyzed': 'true',
  'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.StandardAnalyzer'};
// after
WITH OPTIONS = {'target': 'age', 'mode': 'PREFIX'};
Defensive patterns

Strategy: validation

Validate before calling

// only attach analyzers to text-typed columns
String type = columnType.asCQL3Type().toString();
if (options.get("analyzer_class") != null && !(type.equals("text") || type.equals("ascii") || type.equals("varchar")))
    throw new IllegalArgumentException("Analyzer not compatible with column type " + type);

Try / catch

try {
    session.execute(createIndexStmt);
} catch (InvalidQueryException e) {
    if (e.getMessage().contains("does not support type")) { /* remove analyzer or fix column type */ }
}

Prevention

When it happens

Trigger: IndexMode.validateAnalyzer(options, column) invokes analyzer.validate and the configured 'analyzer_class' is incompatible with the target column's type — e.g. StandardAnalyzer/NonTokenizingAnalyzer on an int, timestamp, or other non-text column.

Common situations: Adding 'analyzed': 'true' with a text analyzer to an index on an int or date column; copy-pasting analyzer options from a text index to a numeric index; custom analyzers with an overly restrictive isCompatibleWith.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/0ca894602fb8fecf. Report an issue: GitHub.