Aman Kumar Sinha
Aman Kumar Sinha

Reputation: 427

How can we export a cassandra table into a csv format using its snapshots file

I have taken snapshot of a cassandra table . Following are the files generated :-

manifest.json                 mc-10-big-Filter.db      mc-10-big-TOC.txt             mc-11-big-Filter.db      mc-11-big-TOC.txt            mc-9-big-Filter.db      mc-9-big-TOC.txt
mc-10-big-CompressionInfo.db  mc-10-big-Index.db       mc-11-big-CompressionInfo.db  mc-11-big-Index.db       mc-9-big-CompressionInfo.db  mc-9-big-Index.db       schema.cql
mc-10-big-Data.db             mc-10-big-Statistics.db  mc-11-big-Data.db             mc-11-big-Statistics.db  mc-9-big-Data.db             mc-9-big-Statistics.db
mc-10-big-Digest.crc32        mc-10-big-Summary.db     mc-11-big-Digest.crc32        mc-11-big-Summary.db     mc-9-big-Digest.crc32        mc-9-big-Summary.db

Is there a way to use these files to extract data of the table into a csv file .

Upvotes: 1

Views: 334

Answers (1)

Carlos Rolo
Carlos Rolo

Reputation: 340

Yes, you can do that with the sstable2json tool.

Use the tool against the *Data.db file

This outputs in JSON format. You need to convert to CSV after.

Upvotes: 1

Related Questions