sstable2json
Converts the on-disk SSTable representation of a table into a JSON formatted document.
Converts the on-disk SSTable representation of a table into a JSON formatted document. Converting SSTables this way is useful for testing and debugging.
Procedure
- Cassandra Package installations:
sstable2json SSTABLE [-k KEY [-k KEY [... ]]]] [-x KEY [-x KEY [... ]]] [-e ]
- Cassandra Tarball installations:
cd install_location/tools $ bin/sstable2json SSTABLE [-k KEY [-k KEY [... ]]]] [-x KEY [-x KEY [... ]]] [-e ]
SSTABLE should be a full path to a {table-name}-Data.db file in Cassandra’s data directory. For example, /var/lib/cassandra/data/Keyspace1/Standard1-e-1-Data.db.
- -k allows you to include a specific set of keys. The KEY must be in HEX format. Limited to 500 keys.
- -x allows you to exclude a specific set of keys. Limited to 500 keys.
- -e causes keys to only be enumerated.
The output is:
{ ROW_KEY: { [ [COLUMN_NAME, COLUMN_VALUE, COLUMN_TIMESTAMP, IS_MARKED_FOR_DELETE], [COLUMN_NAME, ... ], ... ] }, ROW_KEY: { ... }, ... }
Row keys, column names and values are written in as the HEX representation of their byte arrays. Line breaks are only in between row keys in the actual output.
Related topics