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

Matthias Broecheler commented on TINKERPOP-1345:
------------------------------------------------

The reason we chose a map based id representation for DSE Graph instead of a 
list based one was partially motivated by TinkerPop's unrolling behavior - in 
GraphStep as well as HasStep.

While we can make our own id class, non-JVM languages will need to retrieve it 
as a list and bind lists to id variables. To ensure TinkerPop semantics that 
custom id class therefore needs to implement java.util.List. That rules out 
option 1).

For 2), the problem is that the id unrolling happens in the constructor of 
GraphStep, that is, before any strategies are called. So, having a custom step 
doesn't help unless there is a way to inject it earlier. But from reading the 
code it seems we would have to re-implement the entire traversal framework.

Yes, I realize that this is a non-trivial change. However, given how important 
efficient id representation is for OLAP and that List is the most compact, 
universally supported data structure for multiple elements I wanted to suggest 
this change to offer implementations the opportunity to use List for their ids.

> Unrolling of collection for ids
> -------------------------------
>
>                 Key: TINKERPOP-1345
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1345
>             Project: TinkerPop
>          Issue Type: Bug
>            Reporter: Matthias Broecheler
>
> In GraphStep, TinkerPop does this:
> {code}
> this.ids = (ids.length == 1 && ids[0] instanceof Collection) ? ((Collection) 
> ids[0]).toArray(new Object[((Collection) ids[0]).size()]) : ids;
> {code}
> which means that collections are automatically unrolled when there is only 
> one element. This breaks TP implementations that use collections to represent 
> ids, for instance, because their id representation has multiple components 
> (like a primary key in an RDMBS).  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to