jexp / batch-import

generic csv file neo4j batch importer
https://neo4j.com/docs/operations-manual/current/tools/import/
385 stars 157 forks source link

Index users not configured, Neo4j Batch importer 2.0 error #76

Closed mitjarogl closed 10 years ago

mitjarogl commented 10 years ago

I have downloaded Neo4j Community 2.0.0 edition for Windows and zip (CSV) Batch Importer 2.0. I'm trying to import csv files to Neo4j db. For now I'm using just nodes2.csv without relations.

I' m using these samples:

nodes2.csv

name:string:users    age works_on
Michael 37  neo4j
Selina  14
Rana    6
Selma   4

batch.properties

dump_configuration=false
cache_type=none
use_memory_mapped_buffers=true
neostore.propertystore.db.index.keys.mapped_memory=5M
neostore.propertystore.db.index.mapped_memory=5M
neostore.nodestore.db.mapped_memory=200M
neostore.relationshipstore.db.mapped_memory=500M
neostore.propertystore.db.mapped_memory=200M
neostore.propertystore.db.strings.mapped_memory=200M
batch_import.node_index.users=exact

I have executed like this:

C:\Users\X\Desktop\batch_importer_20>import.bat C:\Users\X\Documents\Neo4j\test.db sample\nodes2.csv 

But I get this error:

Exception in thread "main" java.lang.IllegalStateException: Index users not configured.
    at org.neo4j.batchimport.Importer.importNodes(Importer.java:108)
    at org.neo4j.batchimport.Importer.doImport(Importer.java:228)
    at org.neo4j.batchimport.Importer.main(Importer.java:83)
jexp commented 10 years ago

Can you try to provide an empty rels file? Just for testing.

Does it say anything else, like "using existing batch.properties"

mitjarogl commented 10 years ago

I have provided empty rels, but still get error. Yes, it is saying "Using existing configuration File" and I get this error. Exception in thread "main" java.lang.IllegalStateException: Index users age works_on not configured. at org.neo4j.batchimport.Importer.importNodes(Importer.java:108) at org.neo4j.batchimport.Importer.doImport(Importer.java:228) at org.neo4j.batchimport.Importer.main(Importer.java:83)

mrkale commented 10 years ago

Probably you have got no index created as stated in error message. Ommit ":users" from respective field header.

On Sun, Jan 12, 2014 at 8:19 PM, extra90 notifications@github.com wrote:

I have provided empty rels, but still get error. Yes, it is saying "Using existing configuration File" and I get this error. Exception in thread "main" java.lang.IllegalStateException: Index users age works_on not configured.

at org.neo4j.batchimport.Importer.importNodes(Importer.java:108) at org.neo4j.batchimport.Importer.doImport(Importer.java:228) at org.neo4j.batchimport.Importer.main(Importer.java:83)

— Reply to this email directly or view it on GitHubhttps://github.com/jexp/batch-import/issues/76#issuecomment-32130927 .

mitjarogl commented 10 years ago

I have omit ":users" like you said. But still get error, below you can see it . If I omit ":users" then will be no auto-index like I have configured in batch.properties batch_import.node_index.users=exact? However, all nodes are imported.

OUTPUT in cmd

     `Using Existing Configuration File

     Importing 4 Nodes took 0 seconds

     Total import time: 3 seconds

     Exception in thread "main" java.lang.NullPointerException
    at org.neo4j.batchimport.importer.AbstractLineData.createHeaders(Abstrac
    tLineData.java:40)
    at org.neo4j.batchimport.importer.CsvLineData.<init>(CsvLineData.java:16
    )
    at org.neo4j.batchimport.Importer.createLineData(Importer.java:173)
    at org.neo4j.batchimport.Importer.importRelationships(Importer.java:140)

    at org.neo4j.batchimport.Importer.doImport(Importer.java:232)
    at org.neo4j.batchimport.Importer.main(Importer.java:83)`
mrkale commented 10 years ago

Probably you do not have tab separated header of the nodes file. I have simulated the almost the same error with separating "age" by a space from "name" field instead of a tab. Check the csv file and tab it properly.

On Mon, Jan 13, 2014 at 5:14 PM, extra90 notifications@github.com wrote:

I have omit ":users" like you said. But still get error, below you can see it If I omit ":users" then will be no auto-index like I have configured in batch.properties batch_import.node_index.users=exact. However, all nodes are imported.

OUTPUT in cmd

`Using Existing Configuration File

Importing 4 Nodes took 0 seconds

Total import time: 3 seconds Exception in thread "main" java.lang.NullPointerException at org.neo4j.batchimport.importer.AbstractLineData.createHeaders(Abstrac tLineData.java:40) at org.neo4j.batchimport.importer.CsvLineData.(CsvLineData.java:16 ) at org.neo4j.batchimport.Importer.createLineData(Importer.java:173) at org.neo4j.batchimport.Importer.importRelationships(Importer.java:140)

at org.neo4j.batchimport.Importer.doImport(Importer.java:232)
at org.neo4j.batchimport.Importer.main(Importer.java:83)`

— Reply to this email directly or view it on GitHubhttps://github.com/jexp/batch-import/issues/76#issuecomment-32183484 .

mitjarogl commented 10 years ago

I have checked my csv file and it is tab-it properly. Now I get this error, just for users.

Exception in thread "main" java.lang.IllegalStateException: Index users not conf igured.

jexp commented 10 years ago

But the batch.properties that you showed is in the C:\Users\X\Desktop\batch_importer_20 directory? Nowhere else (eg. sample)? The importer looks just in the current directory by default and creates a new config file if there isn't one.

mrkale commented 10 years ago

You have imported your original csv file. Remove index ":users" from the header.

On Tue, Jan 14, 2014 at 9:40 AM, extra90 notifications@github.com wrote:

I have checked my csv file and it is tab-it properly. Now I get this error, just for users.

Exception in thread "main" java.lang.IllegalStateException: Index users not conf igured.

Reply to this email directly or view it on GitHubhttps://github.com/jexp/batch-import/issues/76#issuecomment-32246989 .

mitjarogl commented 10 years ago

@jexp Like you said I was putting batch_import.node_index.users=exact into the subdirectory sample instead of main directory where is also file batch.properties. Thanks for solution. Do you have any test data in csv (tab separated) format, where is about 1 million records. Thanks :)

jexp commented 10 years ago

There is a test-data-generator which can generate simple test data for imports.

Usage (for unix)

./generate.sh #nodes #rels-per-node REL_TYPE1,REL_TYPE2,REL_TYPE3

e.g.
./generate.sh 1000000 25 KNOWS,LOVES,HATES

For windows you would need a batch-file, perhaps adapt import.bat to just call the TestDataGenerator

mitjarogl commented 10 years ago

actually I need some real data, where can I execute some logical queries.

jexp commented 10 years ago

Then you'll have to write a generator yourself or use something like the musicbrainz import dataset ?

http://blog.neo4j.org/2013/11/musicbrainz-in-neo4j-part-1.html