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

[SGrPWNEf] Fixes backslashes parsing in csv import / export #572

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

ncordon
Copy link
Collaborator

@ncordon ncordon commented Jan 17, 2024

Cherry-picks neo4j-contrib/neo4j-apoc-procedures#3898

What

Uses RFC4180Parser instead of CSVParser as suggested here

Why

Because the case where we have a quote " in a value we want to export / import from csv was not working:

CREATE (n:Test {name: 'Test', value: '{"new":"4\'10\\\""}'});
CALL apoc.export.csv.all("test.csv", {bulkImport:'true'});
MATCH (n) DETACH DELETE n;
CALL apoc.import.csv([{fileName: 'file:test.nodes.Test.csv', labels: ['Test']}],[],{});
MATCH (n: Test) RETURN n.value

should give us a roundtrip where the result is "{"new":"4'10\""}"

@ncordon ncordon changed the title [SGrPWNEf] Fixes backslashes parsing in csv import / export (#3898) [SGrPWNEf] Fixes backslashes parsing in csv import / export Jan 17, 2024
@ncordon ncordon merged commit 000de5a into dev Jan 17, 2024
21 checks passed
@ncordon ncordon deleted the dev-fix-csv-import branch January 17, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant