nebula-importer icon indicating copy to clipboard operation
nebula-importer copied to clipboard

Support to import NULL value

Open yixinglu opened this issue 3 years ago • 4 comments

for nullable fields of tag or edge, think about how to import the NULL value in csv file.

yixinglu avatar Oct 14 '21 07:10 yixinglu

+1

zfanswer avatar Mar 31 '22 07:03 zfanswer

We will support this feature recently. And the implementation maybe follow the answer of this question in stackoverflow:

https://stackoverflow.com/questions/2675323/mysql-load-null-values-from-csv-data

@zfanswer if you have more ideas and question about this feature, please be free to raise them here. Thanks.

yixinglu avatar Apr 02 '22 02:04 yixinglu

Thanks for your quick response! Looking forward for the new feature.

zfanswer avatar Apr 02 '22 07:04 zfanswer

Just to put info here after discussion on Slack channel. You can use NULL value instead of standard \N in CSV file to be able to import it into Nebula.

goranc avatar Jul 29 '22 11:07 goranc

@veezhang This needs to be dealt with

The data type of prop1 is float, when prop1 is null in the csv file, the generated insert statement is

INSERT EDGE test (prop1,prop2) VALUES "1001" ->"1002" : (,"2022-04-01")
[ERROR (-1004)]: SyntaxError: syntax error near  `,"2022-0'

even if prop1 is nullable and with default value,the following insert statement can be executed successfully:

INSERT EDGE test (prop1,prop2) VALUES "1001" ->"1002" : (null,"2022-04-01")

dbacyj avatar Dec 04 '22 08:12 dbacyj

@dbacyj It's will be fixed in #238 .

@veezhang This needs to be dealt with

The data type of prop1 is float, when prop1 is null in the csv file, the generated insert statement is

INSERT EDGE test (prop1,prop2) VALUES "1001" ->"1002" : (,"2022-04-01")
[ERROR (-1004)]: SyntaxError: syntax error near  `,"2022-0'

even if prop1 is nullable and with default value,the following insert statement can be executed successfully:

INSERT EDGE test (prop1,prop2) VALUES "1001" ->"1002" : (null,"2022-04-01")

veezhang avatar Dec 06 '22 07:12 veezhang