Wednesday, December 2, 2015

Import JSON records into SSTable

Import JSON records into SSTable


Execute the following command to import JSON records into SSTable.

Syntax:
json2sstable -K KEYSPACE -c COLUMN_FAMILY JSON SSTABLE

Example:
Json2sstable –K mytestkeyspace –c userinfo userinfo.json mytestkeyspace-userinfo-jb-3-Data.db

I have saved the below JSON data into file called, userinfo.json and used as source to import the records.

[{"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