br1ghtyang / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

csv file loader fails for empty csv line (only commas) #604

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Give a csv file containing the following lines:

1,2,3.4,5.6789,2013-08-07,07:22:35
,,,,,,

The following query will reveal the issue:

drop dataverse temp if exists;
create dataverse temp
use dataverse temp;

create type test as closed {
        id: int32,
        integer: int32,
        float: float,
        double: double,
        date: string,
        time: string
    };

create dataset testds (test)
primary key id;

load dataset testds using localfs 
(("path"="127.0.0.1:///Users/jarodwen/Downloads/test.csv"), 
("format"="delimited-text"),("delimiter"=","));

for $i in dataset testds
return $i

And the error is:

empty String [NumberFormatException]

I think we should update the csv loader to skip these empty lines, as it is 
very common for excel to pad the csv files with empty lines. 

Original issue reported on code.google.com by jarod...@gmail.com on 7 Aug 2013 at 2:29

GoogleCodeExporter commented 8 years ago

Original comment by jarod...@gmail.com on 9 Aug 2013 at 3:44

GoogleCodeExporter commented 8 years ago

Original comment by jarod...@gmail.com on 14 Aug 2013 at 1:19

GoogleCodeExporter commented 8 years ago
The fix (1097e49) has been merged back to master.

Original comment by jarod...@gmail.com on 15 Nov 2013 at 5:47