[
https://issues.apache.org/jira/browse/TINKERPOP-2854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679198#comment-17679198
]
Andrea Santurbano commented on TINKERPOP-2854:
----------------------------------------------
{quote}1. Tell us what graph database you are using.
{quote}
As I said I'm using the transpiler via test case which uses an in-memory db
defined here:
[https://github.com/opencypher/cypher-for-gremlin/blob/master/testware/testware-common/src/main/java/org/opencypher/gremlin/server/EmbeddedGremlinServer.java]
{quote}
2. Provide the code you are using to submit the {{Bytecode}} object to Gremlin
Server.
{quote}
[https://github.com/opencypher/cypher-for-gremlin/blob/master/testware/integration-tests/src/test/java/org/opencypher/gremlin/queries/ListSliceTest.java#L168-L180]
{quote}3. Provide us the {{Bytecode}} itself. As i explained in my last post,
the string representation you've been pasting here in this ticket will not help
with this part. You'll need to get us the GraphSON 3.x representation of that
using the {{{}GraphSONMapper{}}}.
{quote}
{code:java}
{"@type":"g:Bytecode","@value":{"step":[["inject","
cypher.start"],["map",{"@type":"g:Bytecode","@value":{"step":[["project","
GENERATED1"," GENERATED2","
GENERATED3"],["by",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int64","@value":1}]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int64","@value":2}]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int64","@value":3}]]}}],["select",{"@type":"g:Column","@value":"values"}]]}}],["project","r"],["by",{"@type":"g:Bytecode","@value":{"step":[["project","
GENERATED5"," GENERATED6","
GENERATED7"],["by",{"@type":"g:Bytecode","@value":{"step":[["identity"]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["choose",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"from","value":{"@type":"g:Int64","@value":3}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"from","value":{"@type":"g:Int64","@value":3}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant","
cypher.null"]]}}]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["choose",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"to","value":{"@type":"g:Int64","@value":1}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"to","value":{"@type":"g:Int64","@value":1}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant","
cypher.null"]]}}]]}}],["select",{"@type":"g:Column","@value":"values"}],["map",{"@type":"g:Lambda","@value":{"script":"cypherListSlice().apply(it)","language":"gremlin-groovy","arguments":1}}]]}}],["inject","
cypher.start"],["map",{"@type":"g:Bytecode","@value":{"step":[["project","
GENERATED1"," GENERATED2","
GENERATED3"],["by",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int64","@value":1}]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int64","@value":2}]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int64","@value":3}]]}}],["select",{"@type":"g:Column","@value":"values"}]]}}],["project","r"],["by",{"@type":"g:Bytecode","@value":{"step":[["project","
GENERATED5"," GENERATED6","
GENERATED7"],["by",{"@type":"g:Bytecode","@value":{"step":[["identity"]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["choose",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"from","value":{"@type":"g:Int64","@value":3}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"from","value":{"@type":"g:Int64","@value":3}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant","
cypher.null"]]}}]]}}],["by",{"@type":"g:Bytecode","@value":{"step":[["choose",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"to","value":{"@type":"g:Int64","@value":1}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Binding","@value":{"key":"to","value":{"@type":"g:Int64","@value":1}}}]]}},{"@type":"g:Bytecode","@value":{"step":[["constant","
cypher.null"]]}}]]}}],["select",{"@type":"g:Column","@value":"values"}],["map",{"@type":"g:Lambda","@value":{"script":"cypherListSlice().apply(it)","language":"gremlin-groovy","arguments":1}}]]}}]]}}{code}
Please lemme know if you need something else.
Thank you so much!
Andrea
> Generated Traversal differs from v3.4.13 to v3.6.1
> --------------------------------------------------
>
> Key: TINKERPOP-2854
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2854
> Project: TinkerPop
> Issue Type: Bug
> Affects Versions: 3.6.1
> Reporter: Andrea Santurbano
> Priority: Major
>
> Hi everybody,
> I'm playing with Gremlin and OpenCypher query transpiler by using the
> following bytecode query:
> {code:java}
> [[], [inject( cypher.start), map([[], [project( GENERATED1, GENERATED2,
> GENERATED3), by([[], [constant(1)]]), by([[], [constant(2)]]), by([[],
> [constant(3)]]), select(values)]]), project(r), by([[], [project(
> GENERATED5, GENERATED6, GENERATED7), by([[], [identity()]]), by([[],
> [choose([[], [constant(binding[from=3])]], [[], [constant(binding[from=3])]],
> [[], [constant( cypher.null)]])]]), by([[], [choose([[],
> [constant(binding[to=1])]], [[], [constant(binding[to=1])]], [[], [constant(
> cypher.null)]])]]), select(values),
> map(lambda[cypherListSlice().apply(it)])]])]]{code}
> Using Gremlin 3.4.13 produces the following traversal:
>
>
> {code:java}
> [InjectStep([ cypher.start]), TraversalMapStep([ProjectStep([ GENERATED1,
> GENERATED2, GENERATED3],[[ConstantStep(1)], [ConstantStep(2)],
> [ConstantStep(3)]]), TraversalMapStep(values)]),
> ProjectStep([r],[[ProjectStep([ GENERATED5, GENERATED6,
> GENERATED7],[[IdentityStep], [ChooseStep([ConstantStep(3),
> HasNextStep],[[(eq(true)), [ConstantStep(3), EndStep]], [(eq(false)),
> [ConstantStep( cypher.null), EndStep]]])], [ChooseStep([ConstantStep(1),
> HasNextStep],[[(eq(true)), [ConstantStep(1), EndStep]], [(eq(false)),
> [ConstantStep( cypher.null), EndStep]]])]]), TraversalMapStep(values),
> LambdaMapStep(lambda)]])]{code}
> while 3.6.1 creates this one (we only upgraded the library and changed some
> package name references):
>
>
> {code:java}
> [InjectStep([ cypher.start]), TraversalMapStep([ProjectStep([ GENERATED1,
> GENERATED2, GENERATED3],[[ConstantStep(1)], [ConstantStep(2)],
> [ConstantStep(3)]]), TraversalMapStep(values)]),
> ProjectStep([r],[[ProjectStep([ GENERATED5, GENERATED6,
> GENERATED7],[[IdentityStep], [ChooseStep([ConstantStep(OUT),
> HasNextStep],[[(eq(true)), [ConstantStep(OUT), EndStep]], [(eq(false)),
> [ConstantStep( cypher.null), EndStep]]])], [ChooseStep([ConstantStep(IN),
> HasNextStep],[[(eq(true)), [ConstantStep(IN), EndStep]], [(eq(false)),
> [ConstantStep( cypher.null), EndStep]]])]]), TraversalMapStep(values),
> LambdaMapStep(lambda)]])]{code}
> Indeed the one in 3.6.1 is the wrong one because it adds some extra steps
> like {*}ConstantStep(IN){*}.
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)