George Peppa
George Peppa

Reputation: 253

Having `Neo.ClientError.Statement.InvalidType` in Neo4j

While running the following query in Neo4j

USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM 'file:///home/peppa/database/ap/aC.csv' AS line
CREATE (:Aporte {Organization: line[1] ,ruc: line[2] , year: line[4] ,date: line[6] ,process: line[7] ,LastName: line[8] ,LastNameM: line [9] ,Name: line[10] ,DocType: line[11] ,DocNum: line[12] ,TypeAp: line[13] ,Nature: line[14]})

I get the following error:

Expected 10 to be a java.lang.String, but it was a java.lang.Long

Don't know if the file is bad structured or my query is wrong. Please Help!!.

EDIT: I keep having the same issues with the following query:

USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'file:////home/peppa/database/aP/AC.csv' AS line
CREATE (:Ap  {dni: toint(line[1]) ,rc: toint(line[0])})

PD: I already tried without toint.

Here is some of the data I'm working with:

"20501723844","06747807"
"20501723844","00803710"
"20501723844","40596835"
"20501723844","41696842"
"20501723844","27241420"
"20501723844","19249405"
"20501723844","23154926"
"20501723844","25446127"
"20501723844","18016385"
"20501723844","07093664"
"20501723844","07286049"
"20501723844","21140951"
"20501723844","10291445"
"20501723844","08866233"
"20501723844","09684232"
"20501723844","28297360"

Upvotes: 0

Views: 826

Answers (1)

Alessandro Negro
Alessandro Negro

Reputation: 517

Have a look at the hints available here.

http://neo4j.com/developer/guide-import-csv/

May be that your dataset has something not expected

Upvotes: 2

Related Questions