{"record":{"id":"e054b5a01f4ce6b5","repo":"apache/cassandra","slug":"unknown-kind-in-sstable","errorCode":null,"errorMessage":"Unknown kind  in sstable ","messagePattern":"Unknown kind  in sstable ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/SSTablePartitions.java","lineNumber":684,"sourceCode":"                    }\n                    else\n                    {\n                        ComplexColumnData complexData = (ComplexColumnData) cd;\n                        if (!complexData.complexDeletion().isLive())\n                            complexTombstoneCount++;\n\n                        for (Cell<?> cell : complexData)\n                            addCell((int) currentTime, liveInfo, cell);\n                    }\n                }\n            }\n            else if (unfiltered instanceof RangeTombstoneMarker)\n            {\n                rangeTombstoneCount++;\n            }\n            else\n            {\n                throw new UnsupportedOperationException(\"Unknown kind \" + unfiltered.kind() + \" in sstable \" + desc.descriptor);\n            }\n        }\n\n        private void addCell(int currentTime, LivenessInfo liveInfo, Cell<?> cell)\n        {\n            cellCount++;\n            if (cell.isTombstone())\n                cellTombstoneCount++;\n            if (cell.isExpiring() && (liveInfo.isEmpty() || cell.ttl() != liveInfo.ttl()) && !cell.isLive(currentTime))\n                cellTtlExpired++;\n        }\n\n        void printPartitionInfo(TableMetadata metadata, boolean partitionsOnly)\n        {\n            String key = metadata.partitionKeyType.getString(this.key);\n            if (partitionsOnly)\n                System.out.printf(\"  Partition: '%s' (%s) %s, size: %s%n\",\n                                  key,","sourceCodeStart":666,"sourceCodeEnd":702,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/SSTablePartitions.java#L666-L702","documentation":"While computing per-partition statistics, PartitionStats iterates the Unfiltered rows of each sstable partition. An Unfiltered must be either a Row or a RangeTombstoneMarker; any other kind is impossible by contract, so an UnsupportedOperationException is thrown naming the kind and sstable descriptor — this indicates a corrupt or misread sstable.","triggerScenarios":"Running the sstable partition-stats tool over a corrupted sstable where deserialization yields an Unfiltered whose kind is neither ROW nor RANGE_TOMBSTONE_MARKER (e.g. static-row confusion or bit-flipped kind byte).","commonSituations":"Bit-rot or hardware corruption in data files; truncated sstable read without checksum catching it; version mismatch reading files written by an incompatible Cassandra version.","solutions":["Run `nodetool scrub` (or offline sstablescrub) on the table to repair/rebuild the corrupted sstable","Verify the sstable files with sstableverify; replace the corrupted file from a replica or backup","Confirm the tool version matches the sstable format version of the data files","Check disk health (SMART) if corruption recurs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check sstable integrity where available\n// sstableverify keyspace1 users  (run before stats tools)","typeGuard":null,"tryCatchPattern":"try { new SSTablePartitions(desc, ...).stats(); }\ncatch (UnsupportedOperationException e) {\n    LOG.error(\"likely corrupt sstable \" + e.getMessage() + \" - run scrub/verify\", e);\n}","preventionTips":["Run sstableverify/nodetool scrub regularly to catch corruption early","Match tool and Cassandra versions to the sstable format version","Monitor disk health; corruption is usually hardware or crash related"],"tags":["sstable","corruption","offline-tools","cassandra"],"backgroundTag":"corrupt-data-file","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}