Wednesday, December 2, 2015

Exporting Cassandra SSTable records to JSON

Execute the following command to export the sstable records into JSON output.

Syntax:
Sstable2json SSTable

Example:Sstable2json mytestkeyspace-userinfo-jb-3-Data.db

In my test machine, i have three records in the userinfo table and those records are exported as below JSON data.

[{"key": "00000001","columns": [["","",1409189265390000], ["age","24",1409189265390000],["name","John",1409189265390000]]},{"key": "00000002","columns": [["","",1409189265421000], ["age","20",1409189265421000], ["name","Rob",1409189265421000]]},{"key": "00000003","columns": [["","",1409189265421000], ["age","53fe8591",1409189265421000,"d"], ["name","Peter",1409189265421000]]}]


Note: You have to specify the complete path for the SSTable filename.

No comments:

Post a Comment