[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15711928#comment-15711928 ] ASF GitHub Bot commented on TINKERPOP-1573: --- Github user okram commented on the issue: https://github.com/apache/tinkerpop/pull/507 I know it sucks. I don't like this any more than you do. Here is the saving grace -- if someone comes up with a better solution, there are only two classes we need to tweak (`Bytecode` and `Bindings`). `Bindings` (besides as a singleton) are never accessed outside of these two classes. Moreover, most of the `Bindings` methods are `protected` and thus, not exposed to users. Only `of` is exposed. I'll merge and perhaps someone down the road comes up with the better solution. ?. > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale >Assignee: Marko A. Rodriguez > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15711914#comment-15711914 ] ASF GitHub Bot commented on TINKERPOP-1573: --- Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/507 Fine. I still think the code sucks (you know, usually I'm dazzled by the beauty of the code you write, but this time, mn...). Anyways.. VOTE: +1 > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale >Assignee: Marko A. Rodriguez > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15710023#comment-15710023 ] ASF GitHub Bot commented on TINKERPOP-1573: --- Github user okram commented on the issue: https://github.com/apache/tinkerpop/pull/507 @dkuppitz --- while your model looks more "natural," the problem is that we will create a `Bindings` instance in `ThreadLocal` for every `Bytecode` creation. Given that `Bindings` are rare (especially given that they are only useful for ScriptEngine languages (and thus only when lambdas are used) -- not Gremlin-Java), then with the model I have, we don't create a bunch of `ThreadLocal` values for "no reason." > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale >Assignee: Marko A. Rodriguez > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15709494#comment-15709494 ] ASF GitHub Bot commented on TINKERPOP-1573: --- Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/507 I don't like the implementation of `Bindings`. Suggestion for an improved implementation: https://gist.github.com/dkuppitz/8bd896d639c3fd8fc27fa33f832e68ef > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale >Assignee: Marko A. Rodriguez > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15708851#comment-15708851 ] ASF GitHub Bot commented on TINKERPOP-1573: --- Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/507 `docker/build.sh -t -i -n` passes. VOTE: +1 > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale >Assignee: Marko A. Rodriguez > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15705713#comment-15705713 ] ASF GitHub Bot commented on TINKERPOP-1573: --- GitHub user okram opened a pull request: https://github.com/apache/tinkerpop/pull/507 TINKERPOP-1573: Bindings don't work in coalesce https://issues.apache.org/jira/browse/TINKERPOP-1573 The solution to this problem uses `ThreadLocal`. It sucks, but I don't know of any other way of doing this. Whats funny is that I knew this problem existed as in my notes, the `ThreadLocal` solution is what I came up with back then. We just never had a test case the demonstrated the anonymous traversal bindings problem and thus, I never implemented the "solution." VOTE +1. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1573 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/507.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 #507 > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15705445#comment-15705445 ] Marko A. Rodriguez commented on TINKERPOP-1573: --- Crap. I see why the problem exists. I can't believe we didn't have any test cases for nested traversals... I don't see an easy solution :( ... trying... > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15705392#comment-15705392 ] Robert Dale commented on TINKERPOP-1573: Looks like nested traversals: {noformat} gremlin> g.withBindings(b).V().has(b.of('l','fof'), b.of('k', 'key'), b.of('v',234)).where(__.has(b.of('l','fof'), b.of('k', 'key'), b.of('v',234))).asAdmin().getBytecode() ==>[[], [V(), has(binding[l=fof], binding[k=key], binding[v=234]), where([[], [has(fof, key, 234)]])]] gremlin> g.withBindings(b).V().has('fof', 'key', 234).where(__.has(b.of('l','fof'), b.of('k', 'key'), b.of('v',234))).asAdmin().getBytecode() ==>[[], [V(), has(fof, key, 234), where([[], [has(fof, key, 234)]])]] {noformat} > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TINKERPOP-1573) Bindings don't work in coalesce
[ https://issues.apache.org/jira/browse/TINKERPOP-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15705121#comment-15705121 ] Marko A. Rodriguez commented on TINKERPOP-1573: --- Weird. Is this specific to {{coalesce}} or nested traversals in general? > Bindings don't work in coalesce > --- > > Key: TINKERPOP-1573 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1573 > Project: TinkerPop > Issue Type: Bug > Components: structure >Affects Versions: 3.2.3 >Reporter: Robert Dale > > {noformat} > gremlin> graph = EmptyGraph.instance() > ==>emptygraph[empty] > gremlin> g = graph.traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.addV('fof').property('key',234) > ==>v[0] > gremlin> b = new Bindings() > ==>{} > gremlin> > g.withBindings(b).V().has('fof','key',234).coalesce(__.V().has(b.of('l','fof'), > b.of('k', 'key'), b.of('v',234)), > __.addV(b.of('nl','fof')).property(b.of('sk','key'), > b.of('sv',234))).property(b.of('nk','newkey'), > b.of('nv','newvalue')).asAdmin().getBytecode() > ==>[[], [V(), has(fof, key, 234), coalesce([[], [V(), has(fof, key, 234)]], > [[], [addV(fof), property(key, 234)]]), property(binding[nk=newkey], > binding[nv=newvalue])]] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)