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

Marko A. Rodriguez commented on TINKERPOP-1060:
-----------------------------------------------

This has to do with how Groovy determines the function to call on the class. 
{{T}} is seen as a {{Function}}. This is bad. I had this same problem with 
{{Column}}. Thus, I tweaked the {{GraphTraversal.by(Function)}} method 
accordingly and now things behave as expected.

{code}
gremlin> g = 
TinkerFactory.createModern().traversal(GraphTraversalSource.build().with(LambdaRestrictionStrategy.instance()))
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().groupCount().by{it.get().label()}
The provided traversal contains a lambda step: LambdaMapStep(lambda)
Display stack trace? [yN]
gremlin> g.V().groupCount().by(label)
==>[software:2, person:4]
gremlin>
{code}

> LambdaRestrictionStrategy too restrictive
> -----------------------------------------
>
>                 Key: TINKERPOP-1060
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1060
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: Daniel Kuppitz
>             Fix For: 3.1.1-incubating
>
>
> It seems like {{LambdaRestrictionStrategy}} considers tokens to be lambdas:
> {noformat}
> gremlin> :> g.V().label().groupCount()
> ==>[country:21, product:77, item:2155, employee:9, region:18, category:8, 
> order:830, customer:91]
> gremlin> :> g.V().groupCount().by(label)
> The provided traversal contains a lambda step: LambdaMapStep(label)
> Display stack trace? [yN]
> {noformat}
> Of course tokens aren't simple objects, but I think they should be allowed / 
> considered to be safe, even if the {{LambdaRestrictionStrategy}} is applied.



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

Reply via email to