How to import/set empty arrays in neo4j admin import?

I am using neo4j admin import command to import data from CSVs. But for array type, I am unable to set a value to store an empty array on the node.
For example, let's say I have a CSV with header

field1:string|:LABEL|:ID|field2:string[]
text1|Test|1|val1~val2~val3
text1|Test|2|

Using the neo4j admin import command, for the node with id 1, I will get field2 = [val1, val2, val3], for the node with id 2, field2 will not exist.

But what do I set in field2 to store field2 = [], I can do that using cypher query but not through admin import.

This is a huge difference between a value being null and a value being empty, how do we differentiate between them if we import data this way?

I couldn't find anything on neo4j admin import documentation or the forums.
What would be the workaround for this?

My Neo4j version is 5.x and my array delimiter is ~ and my CSV delimiter is |.

Possible workarounds:

  1. Treat absence of the property as empty array in your queries
  2. Fix the missing property after import

I will check if there are ways of getting it to work and circle back to you.

Thank you for responding.
Yes, I know about the workaround with the post processing query, but imagine an update query which goes through all the nodes and fixes them like this.
It's a very expensive operation and I am not sure if it will even work. There could be relations involded so even if I want to do it with apoc iterate with parallel: true, there is no guarentee it would work.

Yea, post processing could be "too heavy". But option 1 is not always too messy. It is usually just a question about coalesce(n.field2, []). Many times, I think dealing with absence of value in your queries, actually makes the queries "better". Storing null/empty could be considered waste.

But I have a thread ongoing with some other folks. Will keep you posted.

Thank you.
I understand that option 1 is not bad and if I was working on the application side, this is how I would fix it as well.

But we are trying to achieve a kind of in-place database migration without having to go through the communication overhead mess of application teams to adjust to our back-end change.

Also, since this is open source (I think), I would be happy to contribute to the fix/enhancement, although I will need some pointers on the issue I opened to know where to start.

And at some places we have a genuine need to differentiate between the two, for example:

Based on your last post, it sounds like you need to be able to import both null and empty list. How would you represent null vs empty list in your csv?

Yes I do need to differentiate between both, and how we push them depends on the API.
We can have a special identifier for empty array, for example [] could mean empty array instead of null. Right now [] is treated as an element and stores an array like ["[]"] in the database, and as we know neo doesn't support nested arrays so it kind of doesn't make sense.

It's a matter of preference how you would like to design the API.