Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apoc.export.csv.all() with useTypes and bulkImport does not support Array type for neo4j-admin import #3160

Closed
havardthom opened this issue Sep 9, 2022 · 2 comments
Labels
core-functionality Adding new procedure, function or signature to APOC core

Comments

@havardthom
Copy link
Contributor

Expected Behavior (Mandatory)

The command apoc.export.csv.all("test.csv", {useTypes: true, bulkImport: true}) should correctly add Array type to Array properties for use with neo4j-admin import command.
E.g. the header in exported .csv file should be testList:datatype[] to indicate an array. The value column should use arraydelimiter like a;b;c instead of [a,b,c].
More info on neo4j-admin import data types: https://neo4j.com/docs/operations-manual/current/tools/neo4j-admin/neo4j-admin-import/#import-tool-header-format-properties

Actual Behavior (Mandatory)

The command apoc.export.csv.all("test.csv", {useTypes: true, bulkImport: true}) exports Array properties as String type.
e.g. the header in exported .csv file does not have an explicit type (defaults to string) and the value column is not correctly formatted for use with neo4j-admin import.

How to Reproduce the Problem

  • Create a node with an array property
  • Call apoc.export.csv.all("test.csv", {useTypes: true, bulkImport: true})
  • See that header and column value is not correctly formatted in the .csv file
//Insert here a set of Cypher statements that helps us to reproduce the problem
CREATE (n:Test {strList: ["a", "b"]});
CALL apoc.export.csv.all("test.csv", {useTypes: true, bulkImport: true});

How to Fix the Problem

Rebase and merge this pull request: vga91#76

Specifications (Mandatory)

Currently used versions

Versions

  • OS:
  • Neo4j: 4.4.6
  • Neo4j-Apoc: 4.4.0.4
@havardthom
Copy link
Contributor Author

havardthom commented Sep 15, 2022

There is also an issue with quotes being removed from string values.

e.g. if you have a property stringWithQuote: 'this is " a test', the quote in the string is replaced with a space in the export. So the resulting string value in the csv is

this is   a test

Edit: the quote problem is also related to the bulkImport: true config. Without it quotes in values are escaped correctly

Edit2: I see the quote issue is also fixed by vga91#76

@jexp jexp added the core-functionality Adding new procedure, function or signature to APOC core label Oct 5, 2022
@jexp jexp moved this to Todo in APOC Extended Larus Dec 20, 2022
@vga91 vga91 moved this from Todo to Blocked in APOC Extended Larus Jan 24, 2023
@vga91
Copy link
Collaborator

vga91 commented Feb 18, 2025

Fixed here: neo4j/apoc#403

@vga91 vga91 closed this as completed Feb 18, 2025
@github-project-automation github-project-automation bot moved this from Core issues to Done (check if cherry-pick) in APOC Extended Larus Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-functionality Adding new procedure, function or signature to APOC core
Projects
Status: Done (check if to cherry-pick)
Development

No branches or pull requests

3 participants