Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-03-2020 10:04 AM
Hi ,
I am using Desktop version of Neo4j and need to export my query output file at d:/movies-directed.csv
With<Match n()-[rel]-<(m)> as query
CALL apoc.export.csv.query(query, "d:/movies-directed.csv", {})
YIELD file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data
RETURN file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data
this is throwing error
Failed to invoke procedure apoc.export.csv.query
: Caused by: java.io.FileNotFoundException: \import\D:\movies-directed.csv (The filename, directory name, or volume label syntax is incorrect)
regards
Vivek
02-03-2020 10:27 AM
Make sure you have export enabled in settings. You can find some examples here https://neo4j.com/docs/labs/apoc/current/export/csv/
02-03-2020 10:33 AM
yes it is already enabled. Infact when I set
apoc.import.file.use_neo4j_config=false
then error message changed to
Failed to invoke procedure apoc.export.csv.query
: Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 2: D:\movies-directed.csv
02-03-2020 11:04 AM
I think this is what you meant:
apoc.export.file.enabled=true
02-03-2020 11:10 AM
apoc.export.file.enabled=true
apoc.import.file.use_neo4j_config=false
both are set
02-03-2020 11:24 AM
It looks like from the error message that it's still trying to write to the import directory. Is that we're you're trying to write the file? It may require a restart of the instance to set the changes or they may not have been saved. Other than that, you may want to have use an explicit file path rather than the relative one.
02-04-2020 08:05 AM
I have giving explicit path. D:/abc/abc.csv, however I feel the problem is the colon sign after D.
I guess this feature is not enabled for Windows Desktop version.
02-05-2020 04:23 AM
I've seen it done like D:/// in the import documentation. It might work that way.
02-07-2020 10:45 AM
It did not work.
I have following setting at docker compose file
environment:
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
- NEO4J_apoc_import_file_enabled=true
- NEO4J_dbms_shell_enabled=true
- NEO4J_AUTH=neo4j/agilion2018!
- NEO4J_HEAP_MEMORY=4G
- NEO4J_CACHE_MEMORY=2G
- NEO4JLABS_PLUGINS=["apoc", "graph-algorithms"]
- NEO4J_apoc_export_file_enabled=true
- NEO4J_apoc_import_file_use_neo4j_config=false
Cypher:
With "Match (p:Person)-[rel1:BELONG_TO]->(b:Book)
Return p,b" as query
CALL apoc.export.csv.query(query, "/var/lib/pb.csv", {})
YIELD file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data
RETURN file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data
Error:
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.export.csv.query
: Caused by: java.io.FileNotFoundException: /import/var/lib/pb.csv (No such file or directory)
All the sessions of the conference are now available online