Skip to content

Loading Large CSV file #708

Discussion options

You must be logged in to vote

Hi @dagheggelund, sorry about the delay, I didn't notice you opened a discussion instead of an issue.

You execute the query using Session.RunAsync:

LOAD CSV WITH HEADERS FROM $file AS row
MATCH (from:{fromLink} {{id: row.FromID}})
MATCH (to:{toLink} {{id: row.ToID}})
MERGE (from)-[:{predicate}]->(to)"

You say it sometimes fails, without throwing any exceptions.
I have a few questions:

  1. How does it fail?
  2. Are you awaiting the Task return value?
  3. Are you calling ConsumeAsync() on the result cursor.

I'd expect it look a little something like:

async Task ImportFileAsync(string file, IDriver driver, string database)
{
    await using IAsyncSession session = driver.AsyncSession(x => 
        x.W…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dagheggelund
Comment options

Answer selected by thelonelyvulpes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants