apache/cassandra · error · InvalidRequestException

Materialized views are disabled. Enable in cassandra.yaml…

Error message

Materialized views are disabled. Enable in cassandra.yaml to use.

What it means

Guard in CreateViewStatement.validate() thrown when a CREATE MATERIALIZED VIEW statement is submitted while materialized views are turned off cluster-wide. DatabaseDescriptor.getMaterializedViewsEnabled() reflects the materialized_views_enabled setting in cassandra.yaml, so any MV creation request fails with InvalidRequestException during client-state validation, before schema coordination.

Solutions

  1. Enable materialized views by setting materialized_views_enabled: true in cassandra.yaml on every node and restarting; use SASI or manually maintained denormalized tables as an alternative if MVs should stay disabled; contact the cluster operator if the setting is managed externally.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java:125 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/71fbe769ad9ccadf. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java:125

        this.viewName = viewName;

        this.rawColumns = rawColumns;
        this.partitionKeyColumns = partitionKeyColumns;
        this.clusteringColumns = clusteringColumns;

        this.whereClause = whereClause;

        this.clusteringOrder = clusteringOrder;
        this.attrs = attrs;

        this.ifNotExists = ifNotExists;
    }

    @Override
    public void validate(ClientState state)
    {
        if (!DatabaseDescriptor.getMaterializedViewsEnabled())
            throw ire("Materialized views are disabled. Enable in cassandra.yaml to use.");

        super.validate(state);

        // save the query state to use it for guardrails validation in #apply
        this.state = state;
    }

    @Override
    public boolean compatibleWith(ClusterMetadata metadata)
    {
        return metadata.directory.commonSerializationVersion.isAtLeast(Version.V0);
    }

    @Override
    public Keyspaces apply(ClusterMetadata metadata)
    {
        /*
         * Basic dependency validations

View on GitHub (pinned to 88fd0f6a0e)