vesoft-inc / nebula-importer

Nebula Graph Importer with Go
Apache License 2.0
90 stars 60 forks source link

Support to import NULL value #168

Closed yixinglu closed 1 year ago

yixinglu commented 3 years ago

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

zfanswer commented 2 years ago

+1

yixinglu commented 2 years ago

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.

zfanswer commented 2 years ago

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

goranc commented 2 years ago

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.

dbacyj commented 1 year ago

@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 commented 1 year ago

@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")