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

ASF GitHub Bot commented on TINKERPOP-1673:
-------------------------------------------

GitHub user okram opened a pull request:

    https://github.com/apache/tinkerpop/pull/607

    TINKERPOP-1673: GroovyTranslator produces Gremlin that can't execute on 
:remote

    https://issues.apache.org/jira/browse/TINKERPOP-1673
    
    `GroovyTranslator` now uses Groovy `[...]` map notation instead of `new 
LinkedHashMap(){{ put() }}` notation in order to make the String translation 
from Bytecode to Gremlin-Groovy cleaner and easier to read.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1673

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/607.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #607
    
----
commit e4f6842bc6097750eded8d59095605ba4c81c6ae
Author: Marko A. Rodriguez <[email protected]>
Date:   2017-05-11T21:56:26Z

    using [...] syntax for Map construction in GroovyTranslator instead of new 
LinkedHashMap().

commit b755788c6fe7b902a3e81f3c2f11eb5a8b02c4be
Author: Marko A. Rodriguez <[email protected]>
Date:   2017-05-11T22:00:24Z

    updated CHANGELOG.

----


> GroovyTranslator produces Gremlin that can't execute on :remote
> ---------------------------------------------------------------
>
>                 Key: TINKERPOP-1673
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1673
>             Project: TinkerPop
>          Issue Type: Bug
>    Affects Versions: 3.2.5
>            Reporter: Xian Yi Teng
>            Assignee: Marko A. Rodriguez
>
> It produces such a query:
> {code}
> g.withStrategies(org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LambdaRestrictionStrategy.instance()).V(new
>  LinkedHashMap(){{put("~label","vertex");put("vertex_id",(int) 
> 0);}}).outE("edge").as("e").inV().is(new 
> LinkedHashMap(){{put("~label","vertex");put("vertex_id",(int) 
> 1);}}).select("e")
> {code}
> When run locally, it's fine:
> {code}
> gremlin> new LinkedHashMap(){{put("~label","vertex");put("vertex_id",(int) 
> 3);}}
> ==>~label=vertex
> ==>vertex_id=3
> {code}
> But when run over :remote:
> {code}
> gremlin> new LinkedHashMap(){{put("~label","vertex");put("vertex_id",(int) 
> 3);}}
> org.codehaus.groovy.GroovyBugError cannot be cast to 
> org.codehaus.groovy.control.CompilationFailedException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: 
> org.codehaus.groovy.GroovyBugError cannot be cast to 
> org.codehaus.groovy.control.CompilationFailedException
>       at 
> org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:172)
>       at 
> org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
>       at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
>       at 
> org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
>       at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:497)
>       at 
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:124)
>       at 
> org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:497)
>       at 
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
>       at 
> org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:166)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
>       at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:421)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to