{"record":{"id":"f6103b043219e839","repo":"alibaba/DataX","slug":"to-length-over-limit-maxidlength","errorCode":null,"errorMessage":"to length over limit(${maxIdLength})","messagePattern":"to length over limit\\((.+?)\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/GdbEdge.java","lineNumber":40,"sourceCode":"        return this.from;\n    }\n\n    public void setFrom(final String from) {\n        final int maxIdLength = MapperConfig.getInstance().getMaxIdLength();\n        if (from.length() > maxIdLength) {\n            throw new IllegalArgumentException(\"from length over limit(\" + maxIdLength + \")\");\n        }\n        this.from = from;\n    }\n\n    public String getTo() {\n        return this.to;\n    }\n\n    public void setTo(final String to) {\n        final int maxIdLength = MapperConfig.getInstance().getMaxIdLength();\n        if (to.length() > maxIdLength) {\n            throw new IllegalArgumentException(\"to length over limit(\" + maxIdLength + \")\");\n        }\n        this.to = to;\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":45,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/GdbEdge.java#L22-L45","documentation":"GdbEdge.setTo mirrors setFrom: it enforces MapperConfig.getMaxIdLength() on the edge's destination vertex id and throws IllegalArgumentException when the 'to' value exceeds it. Validation happens at object-build time inside the mapper, before the element is sent to GDB.","triggerScenarios":"importType=EDGE with a to-column value longer than the configured max id length; typically the same class of data as the from-side check but hitting the destination column first if it is the longer one.","commonSituations":"Composite/concatenated destination keys; upstream schema change that lengthened the target-key column; only 'to' exceeding the limit (from passes) so the error singles out destination ids.","solutions":["Apply a deterministic shortening (hash/truncate) to the to-column value, identical to the one used for the destination vertex's own id","Confirm the effective limit from the exception message and keep ids comfortably below it","Validate max(len(to_col)) in the source with SQL before running the migration"],"exampleFix":"-- before: check nothing\nSELECT max(length(fk_to)) FROM edges;\n-- after: pre-validate\nSELECT count(*) FROM edges WHERE length(fk_to) > 256;  -- must be 0","handlingStrategy":"validation","validationCode":"-- pre-migration SQL check (must return 0)\nSELECT count(*) FROM edge_src WHERE length(fk_to) > 256;","typeGuard":"static boolean isValidGdbId(String s) {\n    return s != null && !s.isEmpty() && s.length() <= MapperConfig.getInstance().getMaxIdLength();\n}","tryCatchPattern":"catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"to length over limit\")) {\n        // shorten destination ids deterministically; keep destination vertex ids in sync\n    }\n}","preventionTips":["Pre-validate destination-key lengths in the source with SQL before running the job","Use one hash/truncate transform for all occurrences of a vertex id across edges and vertices"],"tags":["gdb","graph","validation","id-length"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}