asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chen Li <che...@gmail.com>
Subject loading CSV records with comma in the value
Date Sat, 25 Jul 2015 20:51:41 GMT
Not sure if this topic was discussed before.  I was trying to load an
external CVS file using "," as the delimiter.  But the engine failed to
read a file with the following single record:

14, "John Smith, Mary Reeve"


use dataverse pubs;

   create type PaperType as open {
      id: int32,
       authors: string
   }

create external dataset Papers(PaperType)
   using localfs
(("path"="127.0.01:///Users/chenli/tmp/asterix-data/papers.csv"),
   ("format"="delimited-text"),
   ("delimiter"=","));

for $paper in dataset('Papers')
return $paper;

The following is the output, which shows that the comma in the authors
field was incorrectly used to break the field.  Any idea about how to fix
it?

Output
Results:

{ "id": 14, "authors": " \"John Smith" }

Duration of all jobs: 0.091 sec

Success: Query Complete

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message