Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cassandra-loader not recognising column correctly and failed to load data #110

Open
ag26jan opened this issue Jun 15, 2023 · 0 comments
Open

Comments

@ag26jan
Copy link

ag26jan commented Jun 15, 2023

I have created a CQL table like below.

CREATE table testdata.capitalbikeshare_tripdata_1 ("Duration" int PRIMARY KEY,"Start date" timestamp,"End date" timestamp,"Start station number" double,"Start station" VARCHAR,"End station number" double,"End station" VARCHAR,"Bike number" VARCHAR,"Member type" VARCHAR);

Now I wanted to run cassandra-loader so I did the command like this.

[yugabyte@yb-demo-agangwar-n1 ~]$ time ./cassandra-loader -dateFormat 'yyyy-MM-dd HH:mm:ss.SSSSSSX' -f 2017Q1-capitalbikeshare-tripdata.csv -host 10.27.16.6 -schema "example.capitalbikeshare_tripdata_1 (Duration,Start date,End date,Start station number,Start station,End station number,End station,Bike number,Member type)" -user cassandra -pw xxxxx
Column (Duration of table example.capitalbikeshare_tripdata_1 not found

real	0m1.575s
user	0m1.161s
sys	0m0.100s

However the csv file has the column.

[yugabyte@yb-demo-agangwar-n1 ~]$ head -n2 2017Q1-capitalbikeshare-tripdata.csv
"Duration","Start date","End date","Start station number","Start station","End station number","End station","Bike number","Member type"
"221","2017-01-01 00:00:41","2017-01-01 00:04:23","31634","3rd & Tingey St SE","31208","M St & New Jersey Ave SE","W00869","Member"

Also I can do INSERT with same format.

cassandra@ycqlsh:example> INSERT INTO example.capitalbikeshare_tripdata_1 ("Duration", "Start date", "End date", "Start station number", "Start station", "End station number", "End station", "Bike number", "Member type") VALUES (221, '2017-01-01 00:00:41', '2017-01-01 00:04:23', 31634, '3rd & Tingey St SE', 31208, 'M St & New Jersey Ave SE', 'W00869', 'Member');


cassandra@ycqlsh:example> select * from capitalbikeshare_tripdata_1;

 Duration | Bike number | Start date                      | End date                        | Start station number | Start station      | End station number | End station              | Member type
----------+-------------+---------------------------------+---------------------------------+----------------------+--------------------+--------------------+--------------------------+-------------
      221 |      W00869 | 2017-01-01 00:00:41.000000+0000 | 2017-01-01 00:04:23.000000+0000 |                31634 | 3rd & Tingey St SE |              31208 | M St & New Jersey Ave SE |      Member

(1 rows)
cassandra@ycqlsh:example>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant