COPY command in cassandar in docker return error;Failed to import 0 rows: IOError – Can’t open ‘fma_dataset.csv’ for r eading: no matching file found

Published

I want import data from csv to keyspace in cassandra in docker. So I use this command step by step:

docker run --name my-cassandra --network some-network -d cassandra:latest
docker cp fma_dataset.csv my-cassandra:fma_dataset.csv
docker run -it --network some-network --rm cassandra cqlsh my-cassandra
CREATE KEYSPACE fma
           WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
CREATE TABLE fma_test (
track_id text PRIMARY key,
title_track text,
date_released text,
title_album text,
artist text,
duration text,
genre text,
favorites_artist text,
listens_track text,
favorites_track text,
listens_album text,
favorites_album text,
);

COPY fma_test 
(track_id,title_track,date_released,title_album,artist,duration,genre,favorites_artist,listens_track,favorites_track,listens_album,favorites_album) 
FROM 'fma_dataset.csv' WITH HEADER=TRUE;
 But I get this error: 
Failed to import 0 rows: IOError - Can't open 'fma_dataset.csv' for reading: no
matching file found,  given up after 1 attempts

I need to remind you that the file is in the container and has been copied correctly in the path.
please help; Thanks

Source: Docker Questions

Published
Categorised as cassandra, cqlsh, csv, docker, import Tagged , , , ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq