[
https://issues.apache.org/jira/browse/TINKERPOP-1240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Marko A. Rodriguez closed TINKERPOP-1240.
-----------------------------------------
Resolution: Won't Fix
Assignee: Marko A. Rodriguez
This is "fixed" using Lambdas. For instance:
{code}
g.V().map(Lambda.function(String))
{code}
See: http://tinkerpop.apache.org/docs/current/reference/#_the_lambda_solution
There is no need for a {{script}}-step per se. However, if we want it totally
proper like the ticket, we could add
{{map}}/{{flatMap}}/{{filter}}/{{sideEffect}} to the {{TraversalSource}}.
However, unless someone comes up with a use-case for that, then as it stands,
we can currently do {{String}}-based lambdas in Gremlin-Java/etc.
> Provide support g.script("V().map{closure}")
> --------------------------------------------
>
> Key: TINKERPOP-1240
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1240
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.1.1-incubating
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
>
> We have lots in place for remoting traversals -- {{RemoteStep}} and
> {{TraversalVertexProgramStep}}. I think the final piece to this puzzle is
> sending closure-based traversals. I believe we should add:
> {code}
> g.V().out().script("map{it.bulk()}").sum()
> {code}
> I think this would direct compile to:
> {code}
> [GraphStep,VertexStep,ScriptStep,SumStep]
> {code}
> What happens is that this gets fully compiled remotely for both
> {{RemoteGraph}} and {{GraphComputer}}. When a full compilation happens, it
> will look like:
> {code}
> [GraphStep,VertexStep,MapStep,SumStep]
> {code}
> There will exist {{ScriptStrategy}} that will do this:
> * Can be defined by
> {{g.withStrategy(ScriptStrategy.build().engine("gremlin-groovy").create())}}.
> * Will find all {{ScriptSteps}}, evaluate their {{ScriptTraversal}} and then
> insert their steps into the master {{Traversal}}.
> Thats it.
> This also allows people to go so far as:
> {code}
> g.script("V().out().map{..}.in().blah()"}
> {code}
> If they don't want to move between....
> This would allow us to completely deprecate {{:>}} for both {{GremlinServer}}
> and {{HadoopRemoteAcceptor}}... which I believe are the only places they are
> used.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)