Reputation: 11
There is a cassandra table 'products' with columns (id int Primary Key, name text price int).
There is a file with name products.json
i need the commands to insert the specified json data(from products.json file) into the Cassandra table 'products'.
i am using cassandra cqlsh environment.
Upvotes: 1
Views: 262
Reputation: 87234
It's better to install open source DSBulk tool that supports import (and export) of JSON (and CSV) data into Cassandra tables. You have flexibility of mapping JSON fields into table fields. In simplest case the command will look as following:
dsbulk load -url products.json -k keyspace -t products
There is a serie of blog posts about DSBulk, that could provide more information & examples: 1, 2, 3, 4, 5, 6
Upvotes: 0