I am new to cassandra. I created the below cassandra table with primary keys.
Create table Query:
create table DB.EMP(
Name text,
age int,
id int,
loc text,
salary double,
PRIMARY KEY (id,salary)
);
I loaded above table with below data using command:
Command ::: copy emp from '/home/data' with delimiter=',';
Data ::: /home/data
"Sdd,25,123,Chennai,28000"
I am getting this error:
Using 1 child processes
Starting copy of pmm.emp with columns ['id', 'salary', 'age', 'loc', 'name'].
Failed to import 1 rows: ParseError - invalid literal for int() with base 10: 'Sdd' - given up without retries
Failed to process 1 rows; failed rows written to import_db_emp.err
Processed: 0 rows; Rate: 0 rows/s; Avg. rate: 0 rows/s
0 rows imported from 1 files in 0.170 seconds (0 skipped).
Please suggest how can I load the data.
Is there any way I can disable , alphabetical order insertion option except primary keys.
No. Cassandra stores the column names that way to ensure proper on-disk order.
An easy solution would be to specify your column order in your COPY command: