Neo4j provides LOAD CSV cypher command to load data from CSV files into Neo4j or access CSV files via HTTPS, HTTP and FTP. But how do you load data from CSV files available on AWS S3 bucket as access to files requires login to AWS account and have file access? That is possible by making use of presign URL for the CSV file on S3 bucket.

We will quickly walk through on how to create a presign URL for a file on AWS S3 bucket. We will need aws command line utility for it. Once the aws command line utility is installed, setup the aws command line using aws configure command.

Rohans-MacBook-Pro-2:bin rohankharwar$ aws configure
AWS Access Key ID [****************KSRQ]:
AWS Secret Access Key [****************t9gZ]:
Default region name [us-east]: us-east-2
Default output format [None]:

For this example the actors.csv file is available in rohank S3 bucket. Run the below command to create the presign URL for actors.csv file.

aws s3 presign s3://rohank/actors.csv

The command will create and output the following presign URL

https://rohank.s3.amazonaws.com/actors.csv

Then use the URL to access the file from S3 bucket using LOAD CSV as

LOAD CSV WITH HEADERS FROM "https://rohank.s3.amazonaws.com/actors.csv" as row return count(row)

Details


Author:
Rohan Kharwar
Applicable versions:
3.2, 3.3, 3.4, 3.5
Keywords:
AWScliimportneo4j-3.2neo4j-3.3neo4j-3.4neo4j-3.5S3