Copy from CSV - FAMILY SPEAKER NOT FOUND

I spent the last two days checking the available answers on this site and several other sites. I need help with the following ( COPY FROMCSV file) that I come across. I created KEYSPACEand COLUMN FAMILYwithout any problems, but I get COLUMN FAMILY NOT FOUNDwhen I try to copy a CSV file to the Table / Column family. I have included the syntax that I use below. I sincerely would like to help resolve this issue. (Cassandra 2.0.6, CQL3.1.1)

I am new to CQLSH.

CREATE KEYSPACE KS_TERA
  WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };

CREATE COLUMNFAMILY TERA
         (BIT_ID int PRIMARY KEY,
    YEAR int ,  
    DAY_OF_MONTH int ,
    BIT_DATE timestamp ,
    COMP_ID int ,
    CARRIER varchar ,
    CARRIER_NUM int ,
    ORIGIN_SHIP_ID int 
         )
          WITH COMPACT STORAGE;

COPY TERA FROM ‘TERA.CSV’  WITH DELIMITER = ‘,’ AND HEADER = FALSE;

I get an error COLUMN FAMILY NOT FOUND.

+4
source share
2 answers

? , , .

COPY keyspace.columnfamily1 (column1, column2,...) TO 'temp.csv';
COPY keyspace.columnfamily2 (column1, column2,...) FROM 'temp.csv';
+1

, COPY , ( ) :

COPY tera FROM ‘TERA.CSV’  WITH DELIMITER = ‘,’ AND HEADER = FALSE;

, :

COPY tera (column1, column2, ... , columnn) FROM ‘TERA.CSV’  WITH DELIMITER = ‘,’ AND HEADER = FALSE;

, -...

+1

Source: https://habr.com/ru/post/1533829/


All Articles