JanusGraph/janusgraph

An ambiguous error message【Vertex with given id already exists:xxx】

Open

#3,013 建立於 2022年4月17日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Java (1,137 fork)batch import
area/docsgood first issue

倉庫指標

Star
 (4,985 star)
PR 合併指標
 (平均合併 3天 18小時) (30 天內合併 12 個 PR)

描述

  • Version: 0.6.1

  • Storage Backend: cql

    When I insert this data repeatedly, it prompts me: Vertex with given id already exists: 256, actually myID is 1, I think this hint is ambiguous, and it interferes with debugging by myID

    long vertexId = ((StandardJanusGraph) graph).getIDManager().toVertexId(1L);
    g.addV().property(T.id, vertexId).next();
    g.tx().commit();

... at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:584) ...

Line 582 tells you that the vertexId belongs to NormalVertex, and if it can be converted to myID instead of vertexId when prompted by line 584

582  Preconditions.checkArgument(vertexId == null || IDManager.VertexIDType.NormalVertex.is(vertexId), "Not a valid vertex id: %s", vertexId);
583  Preconditions.checkArgument(vertexId == null || ((InternalVertexLabel)label).hasDefaultConfiguration(), "Cannot only use default vertex labels: %s",label);
584  Preconditions.checkArgument(vertexId == null || !config.hasVerifyExternalVertexExistence() || !containsVertex(vertexId), "Vertex with given id already exists: %s", vertexId);

Thanks to the development team for their contribution!

貢獻者指南