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


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
           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 
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

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


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