neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.71k stars 494 forks source link

apoc.import.csv 4.3.0.3 doesn't find URLs beginning with forward slash #2337

Closed bcxpsebastian closed 2 years ago

bcxpsebastian commented 2 years ago

Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.

Expected Behavior (Mandatory)

apoc.import.csv should find URLs starting with "file:/"

Actual Behavior (Mandatory)

org.neo4j.driver.exceptions.ClientException: Failed to invoke procedure apoc.import.csv: Caused by: java.io.IOException: You're providing a directory outside the import directory defined into dbms.directories.import

How to Reproduce the Problem

Example from a liquigraph script:

        CALL apoc.import.csv(
        [
            {fileName: 'file:/masterData/series/masterData_architecture.csv', labels: ['MasterData','Architecture']}
        ],
        [],
        {})

Simple Dataset (where it's possibile)

Empty database.

Steps (Mandatory)

  1. Run cypher with apoc.import.csv

Specifications (Mandatory)

Currently used versions

Versions

I'm pretty sure this used to work in 4.3.0.3 and before, we have always used this script. With APOC 4.3.0.3, we had to remove the first slash, e.g. file:masterData/series/masterData_architecture.csv. This contradicts the documentation at https://neo4j.com/labs/apoc/4.3/overview/apoc.import/apoc.import.csv/

bcxpsebastian commented 2 years ago

I think this is Windows-specific. I have imported data on a Linux environment/kubernetes container with APOC 4.3.0.3 and there were no issues.

vga91 commented 2 years ago

@exxsebastian I think is related to another issue in progress. Just to be sure, can you try with this attached jar?

apoc-4.3.0.4-all.jar.zip

bcxpsebastian commented 2 years ago

I tried it with neo4j 4.3.7 & apoc 4.3.0.4, and the problem persists. I also tried with neo4j 4.4.2 & apoc 4.4.0.1, same issue.

conker84 commented 2 years ago

@exxsebastian did you try with the jar provided by @vga91 ?

bcxpsebastian commented 2 years ago

Sorry, no. I used the published APOC 4.3.0.4 in Neo4j Desktop because I assumed it was the same. Trying it with the provided JAR, this issue is solved and I can import files using my original path names. Thanks for pointing out my mistake. :)