cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks to Neo4j server load csv using cypher

learner
Node Link

I am trying to use the following to load a CSV file from Databricks notebook:

gds.run_cypher('LOAD CSV WITH HEADERS FROM "file:///FileStore/sample.csv" AS row')

The databricks and Neo4j servers are on different machine. I have no problem connecting and running cypher queries. I have uploaded a csv file in Databricks DBFS FIleStore. I want to now read this file as csv (not as dataframe) and create nodes in Neo4j.

The above gives me an error:

ClientError: Couldn't load the external resource at: file:/var/lib/neo4j/import/FileStore/sample.csv

2 REPLIES 2

learner
Node Link

I tried it the following way and it still failed:

gds.run_cypher('LOAD CSV WITH HEADERS FROM "dbfs:///FileStore/sample.csv" AS row') 

Wih the following error:

ClientError: Invalid URL 'dbfs:/FileStore/sample.csv': unknown protocol: dbfs

glilienfield
Ninja
Ninja

You need to place the file in the database’s imports directory. Is it located there?  
you can also use a different path by setting it in the database’s neo4j. config file. 

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.