You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Support SET clause in LOAD DATA to tell the NULL string #5079
for example, we create table t1(a int);
then, use this sql
load data infile '/Users/wangjian/test/a.txt' into table t1 set a=nullif(a, 'null');
which means we set the string 'null' as null value in file.
create table t2(a int, b int);
load data infile '/Users/wangjian/test/a.txt' into table t2 set a=nullif(a, 'null'), a=nullif(a, 'abc'), b=nullif(b, 'bc'), b = nullif(b, 'de');
Activity
jianwan0214 commentedon Sep 19, 2022
https://stackoverflow.com/questions/22300228/mysql-load-data-infile-null-string-in-csv-for-datetime
domingozhang commentedon Sep 19, 2022
\N is still NULL
If the nullif(col_name , value) is true, it returns NULL value.
Such as nullif(a, 'null')
jianwan0214 commentedon Nov 2, 2022
for example, we create table t1(a int);
then, use this sql
load data infile '/Users/wangjian/test/a.txt' into table t1 set a=nullif(a, 'null');
which means we set the string 'null' as null value in file.
jianwan0214 commentedon Nov 2, 2022
create table t2(a int, b int);
load data infile '/Users/wangjian/test/a.txt' into table t2 set a=nullif(a, 'null'), a=nullif(a, 'abc'), b=nullif(b, 'bc'), b = nullif(b, 'de');