database - Load CSV with blank values in MonetDB -


i trying load csv file values should null blank. example, consider following schema:

create table test (     float a,     float b,     float c ); 

i trying load file looks (some rows may have no null values, others may have several).

1.0,1.2,1.3 1.4,,1.5 1.6,,, 1.9,2.0,1.2 

i empty fields (e.g., 2nd field in second row) null in database.

i using following command load csv file:

 copy table '/path/to/file.csv' using delimiters ',','\n','"' null ''; 

and getting following error:

failed import table line 2 field b 'double' expected in '' 

should passing else load command (other null '')?

no, seem doing correctly. have tried replicate test , works me. error seems occur if leave out null '' part of answer.

there several minor errors in code provided, correct code be:

create table test (     float,     b float,     c float );  copy test '/path/to/file.csv' using delimiters ',','\n','"' null ''; 

and in file should remove ',' character:

1.0,1.2,1.3 1.4,,1.5 1.6,, 1.9,2.0,1.2 

if fails, try updating version of monetdb.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -