Tom Kolanko created TINKERPOP-2942:
--------------------------------------

             Summary: properties named ID cannot be used when combined with a 
label
                 Key: TINKERPOP-2942
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2942
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.6.2
            Reporter: Tom Kolanko


When you have a property named `ID` you cannot filter on it when combined with 
a vertex label. Here is a testcase that runs on the gremlin-console:


{code}

gremlin> graph = TinkerFactory.createModern()
==>tinkergraph[vertices:6 edges:6]
gremlin> g = traversal().withEmbedded(graph)
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V(1).property("ID", "ABC")
==>v[1]
gremlin> g.V(1).properties()
==>vp[name->marko]
==>vp[ID->ABC]
==>vp[age->29]
gremlin> g.V().has('ID', 'ABC').count()
==>1
gremlin> g.V().has('PERSON', 'ID', 'ABC').count()
==>0
gremlin> g.V().hasLabel('PERSON').has('ID', 'ABC').count()
==>0
{code}


if you compare the explain plans:
{code}
gremlin> g.V().has('ID', 'ABC').count().explain()
==>Traversal Explanation
====================================================================================================
Original Traversal                    [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]

ConnectiveStrategy              [D]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
IdentityRemovalStrategy         [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
ByModulatorOptimizationStrategy [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
CountStrategy                   [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
MatchPredicateStrategy          [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
FilterRankingStrategy           [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
IncidentToAdjacentStrategy      [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
InlineFilterStrategy            [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
AdjacentToIncidentStrategy      [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
RepeatUnrollStrategy            [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
PathRetractionStrategy          [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
EarlyLimitStrategy              [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
LazyBarrierStrategy             [O]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
TinkerMergeEVStepStrategy       [P]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
TinkerGraphCountStrategy        [P]   [GraphStep(vertex,[]), 
HasStep([ID.eq(ABC)]), CountGlobalStep]
TinkerGraphStepStrategy         [P]   [TinkerGraphStep(vertex,[ID.eq(ABC)]), 
CountGlobalStep]
ProfileStrategy                 [F]   [TinkerGraphStep(vertex,[ID.eq(ABC)]), 
CountGlobalStep]
StandardVerificationStrategy    [V]   [TinkerGraphStep(vertex,[ID.eq(ABC)]), 
CountGlobalStep]

Final Traversal                       [TinkerGraphStep(vertex,[ID.eq(ABC)]), 
CountGlobalStep]
gremlin>
{code}

{code}
gremlin> g.V().has('PERSON', 'ID', 'ABC').count().explain()
==>Traversal Explanation
=======================================================================================================================
Original Traversal                    [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]

ConnectiveStrategy              [D]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
IdentityRemovalStrategy         [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
ByModulatorOptimizationStrategy [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
CountStrategy                   [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
MatchPredicateStrategy          [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
FilterRankingStrategy           [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
IncidentToAdjacentStrategy      [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
InlineFilterStrategy            [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
AdjacentToIncidentStrategy      [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
RepeatUnrollStrategy            [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
PathRetractionStrategy          [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
EarlyLimitStrategy              [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
LazyBarrierStrategy             [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
TinkerMergeEVStepStrategy       [P]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
TinkerGraphCountStrategy        [P]   [GraphStep(vertex,[]), 
HasStep([~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
TinkerGraphStepStrategy         [P]   
[TinkerGraphStep(vertex,[~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
ProfileStrategy                 [F]   
[TinkerGraphStep(vertex,[~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
StandardVerificationStrategy    [V]   
[TinkerGraphStep(vertex,[~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]

Final Traversal                       
[TinkerGraphStep(vertex,[~label.eq(PERSON), ID.eq(ABC)]), CountGlobalStep]
{code}


The `ID.eq(ABC)` part seems to be the same



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to