apache/cassandra · error · IllegalArgumentException

All sstables must be part of the same table

Error message

All sstables must be part of the same table

What it means

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.

Solutions

  1. Restrict the input paths to a single table's SSTables
  2. Split the invocation into one run per table
  3. Filter the glob by the table's name prefix

Example fix

// before
StandaloneSplitter data/ks1/*.db  # users + orders mixed
// after
StandaloneSplitter data/ks1/users-*.db
Defensive patterns

Strategy: validation

Validate before calling

Set<String> cfs = files.stream()
    .map(f -> Descriptor.fromFilename(f).cfname)
    .collect(Collectors.toSet());
if (cfs.size() != 1) throw new IllegalArgumentException("All sstables must be part of the same table");

Try / catch

try { StandaloneSplitter.main(args); }
catch (IllegalArgumentException e) {
    if (e.getMessage().contains("same table")) {
        // split the input list per table and run separately
    } else throw e;
}

Prevention

When it happens

Trigger: Passing SSTables from two different tables of the same keyspace (e.g. users-* and orders-*) to one splitter invocation.

Common situations: Glob over a whole keyspace directory; listing multiple tables in a snapshot; manual path list containing leftovers from another table.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/1753ec2700b312f5. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/StandaloneSplitter.java:101

                    System.out.println("Skipping inexisting file " + file);
                    continue;
                }

                Descriptor desc = SSTable.tryDescriptorFromFile(file);
                if (desc == null) {
                    System.out.println("Skipping non sstable file " + file);
                    continue;
                }

                if (ksName == null)
                    ksName = desc.ksname;
                else if (!ksName.equals(desc.ksname))
                    throw new IllegalArgumentException("All sstables must be part of the same keyspace");

                if (cfName == null)
                    cfName = desc.cfname;
                else if (!cfName.equals(desc.cfname))
                    throw new IllegalArgumentException("All sstables must be part of the same table");

                parsedFilenames.put(desc, desc.getComponents(Collections.emptySet(), desc.getFormat().batchComponents()));
            }

            if (ksName == null || cfName == null)
            {
                System.err.println("No valid sstables to split");
                System.exit(1);
            }

            // Do not load sstables since they might be broken
            Keyspace keyspace = Keyspace.openWithoutSSTables(ksName);
            ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfName);
            String snapshotName = "pre-split-" + currentTimeMillis();

            List<SSTableReader> sstables = new ArrayList<>();
            for (Map.Entry<Descriptor, Set<Component>> fn : parsedFilenames.entrySet())
            {

View on GitHub (pinned to 88fd0f6a0e)