Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction in LOAD CSV #51

Open
benofben opened this issue Sep 5, 2023 · 4 comments
Open

Transaction in LOAD CSV #51

benofben opened this issue Sep 5, 2023 · 4 comments

Comments

@benofben
Copy link
Member

benofben commented Sep 5, 2023

Use transactions in load

:auto LOAD CSV WITH HEADERS FROM 'https://storage.googleapis.com/neo4j-datasets/form13/form13-v2.csv' AS row
CALL { MATCH (m:Manager {managerName:row.managerName})
MATCH (c:Company {cusip:row.cusip})
MERGE (m)-[r:OWNS {reportCalendarOrQuarter:date(row.reportCalendarOrQuarter)}]->(c)
SET r.value = toFloat(row.value), r.shares = toInteger(row.shares)
} IN TRANSACTIONS OF 1000 ROWS;
@benofben
Copy link
Member Author

I'm a bit torn on whether adding the transactions is a better educational thing or just additional complexity that's going to confuse.

@benofben
Copy link
Member Author

We've moved the file, so the proposed thing is now...

:auto LOAD CSV WITH HEADERS FROM 'https://storage.googleapis.com/neo4j-datasets/hands-on-lab/form13-2023.csv' AS row
CALL { MATCH (m:Manager {managerName:row.managerName})
MATCH (c:Company {cusip:row.cusip})
MERGE (m)-[r:OWNS {reportCalendarOrQuarter:date(row.reportCalendarOrQuarter)}]->(c)
SET r.value = toFloat(row.value), r.shares = toInteger(row.shares)
} IN TRANSACTIONS OF 1000 ROWS;

@benofben
Copy link
Member Author

Some sort of syntax error...
image

@zach-blumenfeld
Copy link
Contributor

@benofben for Workspace you don't use :auto for Browser you do. You are using Workspace in that screenshot, hence the error.

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

No branches or pull requests

2 participants