Search code examples
cassandracqlsh

Cassandra Data import from remote CSV using cqlsh COPY


If this is possible in Cassandra. Data import from remote CSV using cqlsh COPY .

copy transc from 'https://s3-us-west-2.amazonaws.com/abc/abc/abc.csv' with header=true;

Solution

  • No, you can't import data from remote csv directly

    But if you are using linux you can do this with curl+cqlsh

    curl 'csv_url' | cqlsh node_ip -u username -p username -k keyspace_name -e "copy views from stdin with header = true"
    

    Example :

    curl 'https://pastebin.com/raw/Re6JPaX4' | cqlsh 192.168.65.199 -u cassandra -p cassandra -k test -e "copy views from stdin with header = true"