{"record":{"id":"1e2490c224e2aa06","repo":"apache/cassandra","slug":"base-table-s-doesn-t-exist","errorCode":null,"errorMessage":"Base table '%s' doesn't exist","messagePattern":"Base table '(.+?)' doesn't exist","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java","lineNumber":155,"sourceCode":"    }\n\n    @Override\n    public Keyspaces apply(ClusterMetadata metadata)\n    {\n        /*\n         * Basic dependency validations\n         */\n        Keyspaces schema = metadata.schema.getKeyspaces();\n        KeyspaceMetadata keyspace = schema.getNullable(keyspaceName);\n        if (null == keyspace)\n            throw ire(\"Keyspace '%s' doesn't exist\", keyspaceName);\n\n        if (keyspace.replicationStrategy.hasTransientReplicas())\n            throw new InvalidRequestException(\"Materialized views are not supported on transiently replicated keyspaces\");\n\n        TableMetadata table = keyspace.tables.getNullable(tableName);\n        if (null == table)\n            throw ire(\"Base table '%s' doesn't exist\", tableName);\n\n        if (keyspace.hasTable(viewName))\n            throw ire(\"Cannot create materialized view '%s' - a table with the same name already exists\", viewName);\n\n        if (keyspace.hasView(viewName))\n        {\n            if (ifNotExists)\n                return schema;\n\n            throw new AlreadyExistsException(keyspaceName, viewName);\n        }\n\n        /*\n         * Base table validation\n         */\n\n        if (table.isCounter())\n            throw ire(\"Materialized views are not supported on counter tables\");","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java#L137-L173","documentation":"Dependency check in CreateViewStatement.apply(): the base table named in the CREATE MATERIALIZED VIEW statement does not exist in the (already resolved) keyspace. A materialized view is derived from a base table, so creation is aborted with InvalidRequestException when keyspace.tables has no entry for tableName.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the base table before creating the view; check the table name spelling, quoting, and keyspace qualification; verify the table still exists (it may have been dropped concurrently) with DESCRIBE TABLES."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}