[ 
https://issues.apache.org/jira/browse/TINKERPOP-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16912371#comment-16912371
 ] 

stephen mallette commented on TINKERPOP-2286:
---------------------------------------------

if {{supportsUserSuppliedIds()}} is {{true}} and the provider doesn't support 
the id given, you might still want to {{Attachable}} calling {{addVertex()}} 
without the id for the graph to generate its own id. I think the idea was that 
the user might be doing a graph data migration from a graph with, for example, 
UUIDs (or "worse" a provider specific id object) to a graph like yours that 
only supports strings. The way that it works now, the graph could generate its 
own id and the migration could take place. If TinkerPop throws an exception, we 
force the user to go an somehow convert all their UUIDs to strings somehow in 
that process. I'm not sure we want to do that, but from your perspective as a 
graph provider, I suppose that option is open to you to throw an exception from 
{{willAllowId()}} but it makes data migration a bit harder as mentioned 
earlier. 

> 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)

Reply via email to