batch-import icon indicating copy to clipboard operation
batch-import copied to clipboard

NegativeArraySizeException when exporting relations

Open bendaizer opened this issue 12 years ago • 8 comments

Hi, I'm having trouble importing my rels.csv file, even with the example given in the readme.md.

code compiled with mvn clean compile assembly:single

end exectued with java -server -Xmx4G -jar ../batch-import/target/batch-import-jar-with-dependencies.jar neo4j/data/data.db nodes.csv rels.csv

the nodes and rels files are those on the readme.md examples

I get this error

Using Existing Configuration File

Importing 5 Nodes took 0 seconds 

Total import time: 0 seconds 
Exception in thread "main" java.lang.NegativeArraySizeException
at org.neo4j.batchimport.importer.RowData.createMapData(RowData.java:37)
at org.neo4j.batchimport.importer.RowData.<init>(RowData.java:27)
at org.neo4j.batchimport.Importer.importRelationships(Importer.java:101)
at org.neo4j.batchimport.Importer.main(Importer.java:63)

bendaizer avatar Dec 13 '12 09:12 bendaizer

Can you share the nodes.csv and rels.csv as a gist ?

jexp avatar Dec 13 '12 09:12 jexp

I simply copied and pasted the nodes and rels on readme.md

but here they are https://gist.github.com/4275389

bendaizer avatar Dec 13 '12 09:12 bendaizer

Those have to be tab separated files, I doubt that copying from a web document creates correct versions. Please check that there are only tabs in between the fields.

jexp avatar Dec 13 '12 10:12 jexp

that may be the issue because I try to replace tabs with space usually, gonna try now

bendaizer avatar Dec 13 '12 10:12 bendaizer

It works ! But it's pretty odd that spaces work in nodes but not in rels !! Thanks by the way :)

bendaizer avatar Dec 13 '12 10:12 bendaizer

OK, just to clear this out a little more, the import of the nodes.csv with spaces instead of tabs was also problematic, but it didn't threw any exceptions simply because it interpreted the whole line as one string attribute, and not various attributes separated with spaces !!!

Conclusion : one must be really careful about the distinciton between spaces and tab !!!!

bendaizer avatar Dec 13 '12 11:12 bendaizer

Yep, I highlight it more in the readme. Thanks.

jexp avatar Dec 13 '12 11:12 jexp

Hey, I've got the same issue. Maybe you should add these files to the repository under a /sample dir?

sheymann avatar Mar 22 '13 13:03 sheymann