We have a scenario where we need to run a Cassandra COPY command get file from FTP server and load data in to Cassandra Tables?
Asked
Active
Viewed 87 times
2 Answers
1
No, you can't directly load remote csv with COPY command
You have to download the csv file from FTP server then you can load the file. 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 table_name 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 table_name from stdin with header = true"

Ashraful Islam
- 12,470
- 3
- 32
- 53
-1
yes it will work example : cqlsh "hostname" -u cassandra -p cassandra -e "COPY statement"

user6238251
- 66
- 1
- 10