1

Hi this is my first project with Cassandra 3.0

I have a csv file with around 3000 columns and I need to import csv to cassandra. How can I achieve this?

Example of csv:

Unnamed row_nr PRD_ID X_01 X_02 X_03 X_04 X_05_1 X_05_10 X_05_11 X_05_12 X_05_13 X_05_14 X_05_15 X_05_16 X_05_17 X_05_18 X_05_19 X_05_2 X_05_20 X_05_21 X_05_22 X_05_23 X_05_24 X_05_25 X_05_26 X_05_27 X_05_28 X_05_29 X_05_3 X_05_30 X_05_31 X_05_32 X_05_33 X_05_34 X_05_35 X_05_36 X_05_37 X_05_38 X_05_39 X_05_4 X_05_40 X_05_41 X_05_42 X_05_43 X_05_44 X_05_45 X_05_46 X_05_47 X_05_48 X_05_49 X_05_5 X_05_50 X_05_51 X_05_52 X_05_53 X_05_54 X_05_55 X_05_56 X_05_57

I have googled and read questions in stackoverflow but they are not helpful. Please shed some light.

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Sarabu Sandeep
  • 165
  • 2
  • 5
  • 14
  • This seems like an awfully big number of columns. Also, it seems that a lot of your fields are just values in a sequence. A good aproach might be to explode it into several tables. But without knowing your actual data and how you want to use it, it's hard to tell – litelite Aug 15 '17 at 13:15
  • I will briefly explain my project. – Sarabu Sandeep Aug 15 '17 at 13:50
  • I have my data in csv files with each file more than 20 GB. So I want to import all the data in csv and store in a database. Then I need analytics on that data so that many users can view them in form of graphs, or tables – Sarabu Sandeep Aug 15 '17 at 13:50
  • You probably should read [this question](https://stackoverflow.com/questions/28645815/copy-cassandra-table-from-csv-file) – Error - Syntactical Remorse Aug 15 '17 at 13:57
  • I am using Widows. That question didnot answer my question. – Sarabu Sandeep Aug 15 '17 at 14:20
  • You could use this command : https://www.datastax.com/blog/simple-data-importing-and-exporting-cassandra . But I think you need to create the table automatically and then import the cvs. Am I correct? – Luciana Oliveira Sep 09 '21 at 11:08
  • This command line to important without specify the column table : https://docs.datastax.com/en/astra-cql/doc/cql/cql_using/useInsertCopyCSV.html – Luciana Oliveira Sep 09 '21 at 11:15

0 Answers0