Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Trying to run periodic commit results in an error #44

Open
jexp opened this issue May 24, 2016 · 2 comments
Open

Trying to run periodic commit results in an error #44

jexp opened this issue May 24, 2016 · 2 comments
Labels

Comments

@jexp
Copy link

jexp commented May 24, 2016

The import files are in "$NEO4J_HOME/import/panama/*"

USING PERIODIC COMMIT 50000
LOAD CSV WITH HEADERS FROM "file:///panama/Intermediaries.csv" AS line
MERGE (n:Node {node_id: line.node_id }) ON CREATE SET n:Intermediary, n += line;

'module' object has no attribute 'SemanticError'

HTTP POST returned response 500

If I run the same query in browser it returns fine.

@nicolewhite
Copy link
Owner

These queries are run like this:

    def cypher(self, statement):
        error = False
        headers = []
        rows = []

        start = datetime.now()
        tx = self.graph.begin()

        try:
            result = tx.run(statement, self.parameters)
            headers = list(result.keys())
            rows = [[x[header] for header in headers] for x in result]
            tx.commit()
        except KeyboardInterrupt:
            tx.rollback()
            error = ""
        except Exception as e:
            error = e

Maybe @nigelsmall has an idea?

@ptrdvds
Copy link

ptrdvds commented Jan 3, 2018

When using "USING PERIODIC COMMIT 250" with "LOAD CSV" in cycli i get the following error; "Executing queries that use periodic commit in an open transaction is not possible. [Neo.ClientError.Statement.SemanticError]"
Running the exact same query in cypher-shell connected to the same Neo4j Node (3.3.1) runs without any problems.

The query:

`USING PERIODIC COMMIT 250

LOAD CSV WITH HEADERS FROM "http://nginx/country.csv" AS countryLine FIELDTERMINATOR ','

MERGE (c:Country { fao: countryLine.fao,
numeric3: countryLine.numeric3,
alpha3: countryLine.alpha3,
alpha2: countryLine.alpha2,
name: countryLine.name })
WITH c
SET c :Geography;`

Tested on :
Cycli version: 0.7.6
Neo4j version: 3.3.1
Python 3.6.3 in python:alpine docker container

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants