De Gninou
De Gninou

Reputation: 357

Neo.ClientError.Statement.TypeError: Expected Long(0) to be a org.neo4j.values.storable

I am importing csv file in Neo4j with the following code:

LOAD CSV WITH HEADERS FROM "file:///datafile.csv" AS row 
MERGE (u:User {id: toInt(row[0])}) 
MERGE (t:Team {id: toInt(row[1])})
MERGE (c:TeamChatSession {id: toInt(row[2])}) 
MERGE (u)-[:CreatesSession{timeStamp: row[3]}]->(c) 
MERGE (c)-[:OwnedBy{timeStamp: row[3]}]->(t)

and I got this error:

Neo.ClientError.Statement.TypeError: Expected Long(0) to be a 
org.neo4j.values.storable.TextValue, but it was a 
org.neo4j.values.storable.LongValue

Here is an overview of the file I am importing.

1588,177,6776,1464233999.0
350,188,6777,1464234000.0
1588,177,6776,1464233999.0
350,188,6777,1464234000.0
740,81,6778,1464234001.0
1068,66,6779,1464234002.0
1554,52,6780,1464234003.0

Please help.

Upvotes: 4

Views: 3756

Answers (1)

cybersam
cybersam

Reputation: 67019

Your CSV file has no header, but your query specifies the WITH HEADERS option. Try again after removing that option.

Also, the TOINT() function is deprecated. You should use TOINTEGER() instead.

And, if your other queries want to treat the timestamp property values as a numeric value, you should use TOINTEGER to convert the row[3] value as well, so that your other queries will not have to always do the same conversion.

Upvotes: 4

Related Questions