1

I am using dsbulk to load dataset into the datastax astra

error message: enter image description here

my table structure:

CREATE TABLE project(
 FL_DATE date, 
 OP_CARRIER text, 
 DEP_DELAY float, 
 ARR_DELAY float, 
 PRIMARY KEY ((FL_DATE), OP_CARRIER)
) WITH CLUSTERING ORDER BY (OP_CARRIER ASC);

my mapping error

enter image description here enter image description here

i try changing datatype still not working. Appreciate if anyone can help me

james kam
  • 49
  • 3
  • I tried to edit the csv file and even build my own csv file to import, it doesn't work. However, it works when i used the datastax dataset https://docs.datastax.com/en/astra-serverless/docs/develop/dev-upload-data.html. i am totally lost now. please help me – james kam Dec 26 '22 at 15:31
  • Are you sure, that there no null entries for FL_DATE or OP_CARRIER in your csv? – Alex Tbk Dec 26 '22 at 15:49
  • Please post the output of `mapping.bad` & `mapping-errors.log` files content here to analyze. Also, post the complete command that you ran along with configuration files, if any (of course, passwords masked). Thanks! – Madhavan Dec 26 '22 at 19:28

1 Answers1

0

Assumptions:

  • Both secure connect bundle and input csv is loacted at /path/to/ directory

Table Structure:

token@cqlsh:payloadtest> DESC TABLE projectjk;

CREATE TABLE projectjk.projectjk (
    fl_date date,
    op_carrier text,
    arr_delay float,
    dep_delay float,
    PRIMARY KEY ((fl_date), op_carrier)
) WITH CLUSTERING ORDER BY (op_carrier ASC)
...;

Starting with an empty table:

token@cqlsh:projectjk> select * from projectjk;

 fl_date | op_carrier | arr_delay | dep_delay
---------+------------+-----------+-----------

(0 rows)

Input sample csv file contents:

% cat /path/to/projectjk.csv 
fl_date,op_carrier,dep_delay,arr_delay
2020-01-01,WN,44.0,363.0
2020-01-02,AN,42.0,143.42

DSBulk configuration contents is:

% cat projectjk.conf 
dsbulk {
 connector {
  name = "csv"
 }
 csv {
  url='/path/to/projectjk.csv'
  header=true
 }
 schema {
   keyspace=projectjk
   table=projectjk
 }
 log.stmt.level=EXTENDED
}
datastax-java-driver {
  basic {
    cloud.secure-connect-bundle="/path/to/secure-connect-projectjk.zip"
  }
  advanced.auth-provider {
    username = "CHANGE_ME"
    password = "CHANGE_ME"
  }
}

DSBulk Load command executed is:

./dsbulk load -f projectjk.conf
blackgreen
  • 34,072
  • 23
  • 111
  • 129
Madhavan
  • 758
  • 4
  • 8