fix(enrich): pipe-delim COPY staging so JSON commas don't break Kuzu#150
Merged
Conversation
Kuzu's CSV parser doesn't respect RFC-4180 quoting and counts commas
inside JSON property values as field separators. On real-world inputs
this aborted BulkLoadEdges with "Copy exception: expected 6 values
per row, but got more" — observed on Markdown depends_on edges and
Python imports whose properties include {"language":"python",
"module":"glob"}.
Switch the staging file delimiter from comma to pipe '|'. Go's
json.Marshal never emits a literal '|', so the separator is
unambiguous. Both copyNodeBatch and copyEdgeBatch flip together.
Adds two regression tests with comma-bearing Properties JSON
(TestBulkLoadEdgesCommaInProperties + TestBulkLoadNodesCommaInProperties)
that fail on main and pass after the fix.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
This was referenced May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Kuzu's CSV parser doesn't honor RFC-4180 quoting and counts commas inside JSON property values as field separators. Observed real-world abort on `~/projects/` enrich:
```
Copy exception: error in file <kuzu-tmp-IMPORTS-...csv>, on line 4:
expected 6 values per row, but got more
```
Triggered by Markdown depends_on edges and Python imports whose Properties JSON includes commas (e.g. `{"language":"python","module":"glob"}`).
Switch the staging file delimiter from comma to pipe `|`. Go's `json.Marshal` never emits a literal `|` character, so the separator is unambiguous. Both `copyNodeBatch` and `copyEdgeBatch` flip together.
Test plan
🤖 Generated with Claude Code