brianmhess / cassandra-loader

Delimited file loader for Cassandra
Apache License 2.0
197 stars 93 forks source link

Cassandra-loader skips first 2 letters of the first row in a csv file #58

Closed xqchen1 closed 7 years ago

xqchen1 commented 7 years ago

Here're the tests:

1. Test1

--CSV file 10206,"6446670_d_01" 10931,"6556670_d_01" 10351,"8313084_d_01" 10581,"7742973_d_01"

I did multiple tests and the first 2 letters of the first column in first row are always skipped. I didn't notice this in the old version 0.18.

-- the first column value of the first row is cut from 10206 to 206.

mykey | subid -----------+-------------- 10581 | 7742973_d_01 10931 | 6556670_d_01 206 | 6446670_d_01 10351 | 8313084_d_01

2. Test2 - it will not load the first row.

1,"aaa" 2,"bbb" 3,"ccc" 4,"hhh"

Processing text1.csv Row has different number of fields (1) than expected (2) Error parsing line 1 in text1.csv: "aaa" DONE: text1.csv number of lines processed: 4 (3 inserted)

-- first row is not loaded id | c1 ----+----- 2 | bbb 3 | ccc 4 | hhh

brianmhess commented 7 years ago

Nice catch. It was caused by some GZIP support I was doing. Should be all good now on master.