Commit d4ecb22
fix(enrich): explicit QUOTE/ESCAPE so Kuzu COPY honors RFC-4180
PR #150 switched the staging file delimiter to '|' to avoid JSON-
property comma collisions. That fixes comma-bearing values but
breaks when an ID itself contains a literal '|' — Istio's EDS
cluster names are exactly this shape:
json:istio/none_cds.json:inbound|7070|tcplocal|s1tcp.none
Go's encoding/csv writer DOES wrap such fields in '"' per RFC-4180.
But Kuzu's CSV reader defaults to BACKSLASH escaping, not the
RFC-4180 doubled-quote form Go produces. With the default Kuzu
escape rule, the pipe-bearing quoted field is parsed as multiple
fields and the COPY aborts:
Copy exception: Error in file ... expected 6 values per row,
but got more.
Fix: pass `QUOTE='"', ESCAPE='"'` explicitly so Kuzu interprets
the RFC-4180 form Go writes. Applies to both copyNodeBatch and
copyEdgeBatch.
End-to-end: `codeiq enrich ~/projects/polyglot-bench/istio` now
exits 0 (was exit 2 pre-fix): 36k nodes, 55k edges, 20 services.
Regression test TestBulkLoadEdgesPipeInTargetID covers the exact
Istio cluster-name shape.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 4a6d82a commit d4ecb22
2 files changed
Lines changed: 59 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | | - | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
| |||
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
266 | | - | |
| 274 | + | |
| 275 | + | |
267 | 276 | | |
268 | | - | |
| 277 | + | |
269 | 278 | | |
270 | 279 | | |
271 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
226 | 272 | | |
227 | 273 | | |
228 | 274 | | |
| |||
0 commit comments