{"record":{"id":"54e7d19cce72ab1f","repo":"apache/cassandra","slug":"s-data-resource-has-no-table","errorCode":null,"errorMessage":"%s data resource has no table","messagePattern":"(.+?) data resource has no table","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/auth/DataResource.java","lineNumber":231,"sourceCode":"        return level == Level.TABLE;\n    }\n    /**\n     * @return keyspace of the resource. Throws IllegalStateException if it's the root-level resource.\n     */\n    public String getKeyspace()\n    {\n        if (isRootLevel())\n            throw new IllegalStateException(\"ROOT data resource has no keyspace\");\n        return keyspace;\n    }\n\n    /**\n     * @return column family of the resource. Throws IllegalStateException if it's not a table-level resource.\n     */\n    public String getTable()\n    {\n        if (!isTableLevel())\n            throw new IllegalStateException(String.format(\"%s data resource has no table\", level));\n        return table;\n    }\n\n    /**\n     * @return Whether or not the resource has a parent in the hierarchy.\n     */\n    public boolean hasParent()\n    {\n        return level != Level.ROOT;\n    }\n\n    /**\n     * @return Whether or not the resource exists in Cassandra.\n     */\n    public boolean exists()\n    {\n        switch (level)\n        {","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/auth/DataResource.java#L213-L249","documentation":"IllegalStateException from DataResource.getTable(): the resource's level is below TABLE (root, keyspace-only, or a non-table level resource), so it has no column family to return. The getter's contract requires a table-level resource; getKeyspace() has an analogous guard for the root resource.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/auth/DataResource.java:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call isTableLevel() before getTable() and handle non-table resources separately","Construct the resource at table level (datastores/keyspaces/tables) when a table name is required","Trace the caller (e.g. maybeCorrectResource) and skip or skip-level resources that are not table scoped"],"exampleFix":null,"handlingStrategy":"type-guard","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"}