Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export data from cassandra to Json file using Python or other language?

I want to export data from Cassandra to Json file, because Pentaho didn't support my version of Cassandra 3.10

like image 814
Kikou Avatar asked Feb 13 '26 22:02

Kikou


1 Answers

You can simply add json after select to get your results in json format:

cqlsh:cycling> select json name, checkin_id, timestamp from checkin;
 [json]
------------------------------------------------------------------------------------------------------------------
 {"name": "BRAND", "checkin_id": "50554d6e-29bb-11e5-b345-feff8194dc9f", "timestamp": "2016-08-28 21:45:10.406Z"}
  {"name": "VOSS", "checkin_id": "50554d6e-29bb-11e5-b345-feff819cdc9f", "timestamp": "2016-08-28 21:44:04.113Z"}
(2 rows)

Taken from https://docs.datastax.com/en/cql/3.3/cql/cql_using/useQueryJSON.html

like image 183
Mandraenke Avatar answered Feb 15 '26 12:02

Mandraenke