{"record":{"id":"2b3193fa9b95eabf","repo":"alibaba/DataX","slug":"to-or-from-missed-in-edge","errorCode":null,"errorMessage":"to or from missed in edge","messagePattern":"to or from missed in edge","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/mapping/DefaultGdbMapper.java","lineNumber":96,"sourceCode":"\n                    if (key == null || name == null) {\n                        continue;\n                    }\n                    addToProperties(e, key, name, type, card);\n                }\n            });\n        }\n\n        final BiConsumer<Record, GdbElement> ret = (r, e) -> {\n            final String label = forStrColumn(numPattern, rule.getLabel()).apply(r);\n            String id = forStrColumn(numPattern, rule.getId()).apply(r);\n\n            if (rule.getImportType() == Key.ImportType.EDGE) {\n                final String to = forStrColumn(numPattern, rule.getTo()).apply(r);\n                final String from = forStrColumn(numPattern, rule.getFrom()).apply(r);\n                if (to == null || from == null) {\n                    log.error(\"invalid record to: {} , from: {}\", to, from);\n                    throw new IllegalArgumentException(\"to or from missed in edge\");\n                }\n                ((GdbEdge)e).setTo(to);\n                ((GdbEdge)e).setFrom(from);\n\n                // generate UUID for edge\n                if (id == null) {\n                    id = UUID.randomUUID().toString();\n                }\n            }\n\n            if (id == null || label == null) {\n                log.error(\"invalid record id: {} , label: {}\", id, label);\n                throw new IllegalArgumentException(\"id or label missed\");\n            }\n\n            e.setId(id);\n            e.setLabel(label);\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/mapping/DefaultGdbMapper.java#L78-L114","documentation":"In gdbwriter's DefaultGdbMapper, for EDGE import type each record must produce non-null 'to' and 'from' vertex ids (resolved via forStrColumn from the configured column rules). If either resolves to null, the mapper throws IllegalArgumentException after logging the invalid record — an edge cannot exist without both endpoint ids.","triggerScenarios":"gdbwriter job with importType=EDGE where the record's to/from column values are null, or the configured column index/name mapping for to/from does not exist so the rule resolves null. Also a '$to'/'$from' placeholder typo in the mapping JSON.","commonSituations":"Source rows with NULL foreign keys; writer column list order not matching the reader's column order so to/from point at wrong (possibly null) columns; mapping JSON referencing renamed columns after upstream schema change.","solutions":["Check the logged 'invalid record to: {}, from: {}' line to identify which side is null and for which record","Fix null endpoint ids at the source or filter such rows (reader where-filter) before the writer","Verify the writer's 'column' mapping: to/from entries must reference existing columns carrying vertex ids","If null to/from is legitimately possible, decide policy (skip row) — the plugin has no skip option, so pre-filter"],"exampleFix":"// before: reader emits rows where fk can be null\n// after: filter at read time\n\"where\": \"fk_to is not null and fk_from is null-free-equivalent\"","handlingStrategy":"validation","validationCode":"// filter rows lacking endpoint ids before the writer sees them (reader-level)\n\"where\": \"fk_to IS NOT NULL AND fk_from IS NOT NULL\"","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) {\n    if (\"to or from missed in edge\".equals(e.getMessage())) {\n        // log already printed the offending to/from; re-run with a where-filter to skip such rows\n    }\n    throw e;\n}","preventionTips":["Add NOT NULL constraints (or reader where-filters) on endpoint foreign keys before edge migration","Double-check writer column mapping order so to/from point at the actual id columns"],"tags":["gdb","graph","edge","mapping","datax"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}