[
https://issues.apache.org/jira/browse/TINKERPOP-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16911702#comment-16911702
]
Xin Wei commented on TINKERPOP-2286:
------------------------------------
If supportsUserSuppliedIds() is false, then I agree it's useful to behave in
the current way by just calling addVertex() without the original ID. However if
supportsUserSuppliedIds() is true, but say the provider just doesn't support
numericIds, then it feels more appropriate to error out. Or perhaps there
should be a parameter passed to read() where the user can specify whether to
strictly abide by the original data (if strict=true, error out if data can't be
faithfully reproduced in loaded graph). We can certainly experiment with
throwing custom exceptions, but just wanted to get your opinion on the default
behavior.
> ID type support bug causing regression when loading data
> --------------------------------------------------------
>
> Key: TINKERPOP-2286
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2286
> Project: TinkerPop
> Issue Type: Bug
> Components: structure
> Affects Versions: 3.4.3
> Environment: Linux
> Reporter: Xin Wei
> Priority: Blocker
>
> Our provider version only supports string id, however when loading data with
> numeric ids via g.io().read().iterate() the DB didn't error out, but assigned
> random ids to those vertices with numeric ids, causing regression.
> The cause is :
> [https://github.com/apache/tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java#L803]
>
> The allowId() method returns false when supportsStringIds() returns true and
> id is not instance of string.
> Then this method:
> [https://github.com/apache/tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java#L291]
> will not pass id into Graph.addVertex() method, making underlying method
> assign internal ids to the vertex, causing regression between the data we
> load and the data we store in the DB.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)