Example of how to get output from sstable2json
For the benefit of other developers:
1. Start Cassandra
2. Fire up cqlsh
3. Create a keyspace:
CREATE KEYSPACE test WITH replication =
{'class': 'SimpleStrategy', 'replication_factor': 1};
4. Create a CF
CREATE TABLE test.test2
(
key varchar PRIMARY KEY,
string varchar,
number int,
flag boolean
);
5. Populate the CF with a key (or lots of keys...)
INSERT INTO test.test2 (key, string, number, flag)
VALUES ('first_key', 'varchuuur', 312, false);
6. Flush the data (so it gets saved from the memtable into an sstable)
7. Stop Cassandra
8. run sstable2json
./bin/sstable2json /var/lib/cassandra/data/test/test2/test-test2-jb-1-Data.db;
Output:
[
{
"key": "66697273745f6b6579","columns":
[
["","",1378042590383000],
["flag","true",1378042590383000], ["number","312",1378042590383000],
["string","varchuuur",1378042590383000]
]
}
]