Reader small image

You're reading from  Graph Data Processing with Cypher

Product typeBook
Published inDec 2022
PublisherPackt
ISBN-139781804611074
Edition1st Edition
Concepts
Right arrow
Author (1)
Ravindranatha Anthapu
Ravindranatha Anthapu
author image
Ravindranatha Anthapu

Ravindranatha Anthapu has more than 25 years of experience in working with W3C standards or building cutting-edge technologies like integrating speech with mobile applications in the 2000s. He is a technology enthusiast who worked from operating system device drivers to writing compilers for C language to modern web technologies, transitioning seamlessly and bringing experience from each of these domains and technologies to deliver successful solutions today. As a Principal Consultant at Neo4j today, Ravindranatha works with large enterprise customers to make sure they are able to leverage graph technologies effectively across various domains.
Read more about Ravindranatha Anthapu

Right arrow

Loading data with LOAD CSV using batching

When you have a large amount of data, then you should try to commit the data in batches so that you do not need a large heap to process the data.

There are two options to process the data in batches.

  • USING PERIODIC COMMIT
  • CALL IN TRANSACTIONS

Let’s now go through these two options next.

USING PERIODIC COMMIT

This is an older syntax and is deprecated from Neo4j 4.4 version onward, but if you are using Neo4j software prior to this version, then you must use this option to commit data in batches:

:auto USING PERIODIC COMMIT 1
LOAD CSV WITH HEADERS from "file:///data.csv" AS row
WITH row
MERGE (p:Person {id:row.id})
SET p.firstName = row.firstName,
    p.lastName = row.lastName

This command will execute a commit after processing one row at a time.

CALL IN TRANSACTIONS

This is the newer syntax and is available from Neo4j 4.4 onward:

:auto LOAD CSV WITH HEADERS from ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Graph Data Processing with Cypher
Published in: Dec 2022Publisher: PacktISBN-13: 9781804611074

Author (1)

author image
Ravindranatha Anthapu

Ravindranatha Anthapu has more than 25 years of experience in working with W3C standards or building cutting-edge technologies like integrating speech with mobile applications in the 2000s. He is a technology enthusiast who worked from operating system device drivers to writing compilers for C language to modern web technologies, transitioning seamlessly and bringing experience from each of these domains and technologies to deliver successful solutions today. As a Principal Consultant at Neo4j today, Ravindranatha works with large enterprise customers to make sure they are able to leverage graph technologies effectively across various domains.
Read more about Ravindranatha Anthapu