PS - Here is a snippet from my approach to grading (I use SQL++) based on SQL++'ing against CSV data:

CREATE EXTERNAL DATASET Grades(GradeRecord) USING localfs
(("path"="localhost:///Users/mikejcarey/Desktop/Teaching/CS122a/CS122AStudentData2021.csv"),
       ("format"="delimited-text"), ("delimiter"=","));

For you I guess this would be:

CREATE EXTERNAL DATASET csv_set(csv_type) USING localfs
(("path"="127.0.0.1:///Users/nicholassantini/Downloads/test 2.csv"),
       ("format"="delimited-text"), ("delimiter"=","));

Try that?


On 5/5/22 2:11 PM, Nicholas Santini wrote:
Hi all,

Im using the following code to load a csv file into my database, However, any time there is an empty field it seems to skip the entire row. For example test,1,3 works but test1,1,  doesn't create an entry. Does anyone know why it does this or how to fix it?


drop dataverse csv if exists;
create dataverse csv;
use csv;

create type csv_type as {
    Cross_Street: string,
    lat: int32,
    long: int32?
};

create dataset csv_set (csv_type)
  primary key lat;


  load dataset csv_set using localfs
      (("path"="127.0.0.1 <http://127.0.0.1>:///Users/nicholassantini/Downloads/test 2.csv"),
       ("format"="delimited-text"));


 SELECT *
     FROM csv_set csv_type

Reply via email to