br1ghtyang / asterixdb

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

line-ending and EOF of a csv file is not properly handled #605

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Current csv loader will cause an "incorrect format" if there is no empty line 
at the end of the csv file. I tried the following query:

==================>
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
<==================

This query will fail for this csv file:

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

But it will work for this csv file (notice the empty line):

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

<=======================

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

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