{"record":{"id":"9a1f4b5183f4611c","repo":"prestodb/presto","slug":"not-supported-9a1f4b","errorCode":"NOT_SUPPORTED","errorMessage":"More than one keyspace has been found for the schema name: %s -> (%s, %s)","messagePattern":"More than one keyspace has been found for the schema name: (.+?) -> \\((.+?), (.+?)\\)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-cassandra/src/main/java/com/facebook/presto/cassandra/NativeCassandraSession.java","lineNumber":376,"sourceCode":"    }\n\n    private KeyspaceMetadata getKeyspaceByCaseSensitiveName0(String caseSensitiveSchemaName)\n            throws SchemaNotFoundException\n    {\n        Map<CqlIdentifier, KeyspaceMetadata> keyspaces =\n                executeWithSession(session -> session.getMetadata().getKeyspaces());\n        KeyspaceMetadata result = null;\n        // Ensure that the error message is deterministic\n        List<KeyspaceMetadata> sortedKeyspaces = Ordering.from(comparing((KeyspaceMetadata ks) -> ks.getName().asInternal()))\n                .immutableSortedCopy(keyspaces.values());\n        for (KeyspaceMetadata keyspace : sortedKeyspaces) {\n            if (namesMatch(keyspace.getName().asInternal(), caseSensitiveSchemaName, caseSensitiveNameMatchingEnabled)) {\n                if (caseSensitiveNameMatchingEnabled) {\n                    result = keyspace;\n                    break;\n                }\n                if (result != null) {\n                    throw new PrestoException(\n                            NOT_SUPPORTED,\n                            format(\"More than one keyspace has been found for the schema name: %s -> (%s, %s)\",\n                                    caseSensitiveSchemaName.toLowerCase(ROOT), result.getName().asInternal(), keyspace.getName().asInternal()));\n                }\n                result = keyspace;\n            }\n        }\n\n        if (result == null) {\n            throw new SchemaNotFoundException(caseSensitiveSchemaName);\n        }\n        return result;\n    }\n\n    private static boolean namesMatch(String actualName, String expectedName, boolean caseSensitive)\n    {\n        return caseSensitive\n                ? actualName.equals(expectedName)","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-cassandra/src/main/java/com/facebook/presto/cassandra/NativeCassandraSession.java#L358-L394","documentation":"With case-insensitive name matching (caseSensitiveNameMatchingEnabled=false), the connector scans all keyspaces for names matching the requested schema; if two distinct keyspaces match (e.g. 'Foo' and 'foo'), it refuses to guess and throws NOT_SUPPORTED listing both.","triggerScenarios":"Referencing a schema name that, lowercased, collides with two or more existing Cassandra keyspaces while case-sensitive name matching is disabled.","commonSituations":"Migrated clusters that contain both 'MyKeyspace' and 'mykeyspace'; tools creating keyspaces with differing cases; shared clusters used by apps that ignore case conventions.","solutions":["Rename or drop one of the duplicate keyspaces so the lowercase names are unique","Set cassandra.case-sensitive-name-matching=true and reference the schema with its exact case","Fully qualify queries using the exact keyspace name and enable case-sensitive matching in the catalog","Prevent future collisions by enforcing lowercase keyspace naming conventions"],"exampleFix":"// before: etc/catalog/cassandra.properties\ncassandra.case-sensitive-name-matching=false\n\n// after\ncassandra.case-sensitive-name-matching=true\n// then query: SELECT * FROM \"MyKeyspace\".t","handlingStrategy":"validation","validationCode":"String wanted = schemaName.toLowerCase(Locale.ROOT);\nlong matches = keyspaces.stream()\n    .map(k -> k.getName().asInternal().toLowerCase(Locale.ROOT))\n    .filter(wanted::equals)\n    .distinct()\n    .count();\nif (matches > 1) {\n    throw new IllegalStateException(\"Ambiguous schema name across keyspaces: \" + schemaName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    return metadata.getSchemaNames() /* or table lookup */;\n} catch (PrestoException e) {\n    if (NOT_SUPPORTED.toErrorCode().getCode() == e.getErrorCode().getCode()\n            && e.getMessage().startsWith(\"More than one keyspace\")) {\n        throw new IllegalArgumentException(\"Enable case-sensitive name matching or dedupe keyspaces\", e);\n    }\n    throw e;\n}","preventionTips":["Enforce lowercase, unique keyspace naming in the cluster","Enable cassandra.case-sensitive-name-matching if mixed-case keyspaces must coexist","Audit keyspaces for case collisions after migrations"],"tags":["cassandra","naming-collision","case-insensitivity","schema-resolution"],"backgroundTag":"ambiguous-case-insensitive-name","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}