{"record":{"id":"1753ec2700b312f5","repo":"apache/cassandra","slug":"all-sstables-must-be-part-of-the-same-table","errorCode":null,"errorMessage":"All sstables must be part of the same table","messagePattern":"All sstables must be part of the same table","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/StandaloneSplitter.java","lineNumber":101,"sourceCode":"                    System.out.println(\"Skipping inexisting file \" + file);\n                    continue;\n                }\n\n                Descriptor desc = SSTable.tryDescriptorFromFile(file);\n                if (desc == null) {\n                    System.out.println(\"Skipping non sstable file \" + file);\n                    continue;\n                }\n\n                if (ksName == null)\n                    ksName = desc.ksname;\n                else if (!ksName.equals(desc.ksname))\n                    throw new IllegalArgumentException(\"All sstables must be part of the same keyspace\");\n\n                if (cfName == null)\n                    cfName = desc.cfname;\n                else if (!cfName.equals(desc.cfname))\n                    throw new IllegalArgumentException(\"All sstables must be part of the same table\");\n\n                parsedFilenames.put(desc, desc.getComponents(Collections.emptySet(), desc.getFormat().batchComponents()));\n            }\n\n            if (ksName == null || cfName == null)\n            {\n                System.err.println(\"No valid sstables to split\");\n                System.exit(1);\n            }\n\n            // Do not load sstables since they might be broken\n            Keyspace keyspace = Keyspace.openWithoutSSTables(ksName);\n            ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfName);\n            String snapshotName = \"pre-split-\" + currentTimeMillis();\n\n            List<SSTableReader> sstables = new ArrayList<>();\n            for (Map.Entry<Descriptor, Set<Component>> fn : parsedFilenames.entrySet())\n            {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/StandaloneSplitter.java#L83-L119","documentation":"StandaloneSplitter.main also requires all provided SSTables to belong to the same table within the validated keyspace. If a later descriptor's cfname differs from the first, it throws IllegalArgumentException.","triggerScenarios":"Passing SSTables from two different tables of the same keyspace (e.g. users-* and orders-*) to one splitter invocation.","commonSituations":"Glob over a whole keyspace directory; listing multiple tables in a snapshot; manual path list containing leftovers from another table.","solutions":["Restrict the input paths to a single table's SSTables","Split the invocation into one run per table","Filter the glob by the table's name prefix"],"exampleFix":"// before\nStandaloneSplitter data/ks1/*.db  # users + orders mixed\n// after\nStandaloneSplitter data/ks1/users-*.db","handlingStrategy":"validation","validationCode":"Set<String> cfs = files.stream()\n    .map(f -> Descriptor.fromFilename(f).cfname)\n    .collect(Collectors.toSet());\nif (cfs.size() != 1) throw new IllegalArgumentException(\"All sstables must be part of the same table\");","typeGuard":null,"tryCatchPattern":"try { StandaloneSplitter.main(args); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"same table\")) {\n        // split the input list per table and run separately\n    } else throw e;\n}","preventionTips":["Glob by table prefix (e.g. users-*.db) instead of a whole directory","Run one splitter invocation per table","Audit the file list (Descriptor cfname) before running"],"tags":["cli","sstables","offline-tools"],"backgroundTag":"invalid-argument-value","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"}