TP/Spark OLAP valid queries ?

46 views
Skip to first unread message

David

unread,
Jan 26, 2016, 5:29:05 PM1/26/16
to Gremlin-users
Hi,

I have TinkerPop 3.1.1-SNAPSHOT installed running with Spark 1.5.2.

I am getting NullPointer exceptions on a few of the queries I tried.

It might be that I do not fully understand the limitations of OLAP Gremlin mentioned here:
http://tinkerpop.apache.org/docs/3.1.0-incubating/#distributed-gremlin-gotchas

"properties" seems to be the common theme.

I can attach a stack trace if needed, but wanted advice on the validity in the OLAP
realm of the queries returning Null Pointers first.

Thank you,



........
gremlin> g.V().propertyMap()
==>[name:[vp[name->josh]], age:[vp[age->32]]]
==>[name:[vp[name->marko]], age:[vp[age->29]]]
==>[name:[vp[name->peter]], age:[vp[age->35]]]
==>[name:[vp[name->lop]], lang:[vp[lang->java]]]
==>[name:[vp[name->ripple]], lang:[vp[lang->java]]]
==>[name:[vp[name->vadas]], age:[vp[age->27]]]
gremlin> g.V().out().out().not(__.has('name','ripple')).properties()
java.lang.NullPointerException
Display stack trace? [yN] n
gremlin> g.V().out().in().not(__.has('name','ripple')).properties()
java.lang.NullPointerException
Display stack trace? [yN] n
gremlin> g.V().out('created').in('created').not(__.has('name','ripple')).properties()
java.lang.NullPointerException
Display stack trace? [yN] n
gremlin> g.V().out('created').in('created').not(__.has('name','ripple')).propertyMap()
==>[name:[vp[name->josh]], age:[vp[age->32]]]
==>[name:[vp[name->josh]], age:[vp[age->32]]]
==>[name:[vp[name->josh]], age:[vp[age->32]]]
==>[name:[vp[name->josh]], age:[vp[age->32]]]
==>[name:[vp[name->marko]], age:[vp[age->29]]]
==>[name:[vp[name->marko]], age:[vp[age->29]]]
==>[name:[vp[name->marko]], age:[vp[age->29]]]
==>[name:[vp[name->peter]], age:[vp[age->35]]]
==>[name:[vp[name->peter]], age:[vp[age->35]]]
==>[name:[vp[name->peter]], age:[vp[age->35]]]
gremlin> g.V().out('created').in('created').not(__.has('name','ripple')).values()
==>josh
==>josh
==>josh
==>josh
==>32
==>32
==>32
==>32
==>marko
==>marko
==>marko
==>29
==>29
==>29
==>peter
==>peter
==>peter
==>35
==>35
==>35
gremlin> g.V().properties('name').count()
==>6



Marko Rodriguez

unread,
Jan 26, 2016, 5:38:30 PM1/26/16
to gremli...@googlegroups.com
Huh,

I suspect its using Groovy meta-class properties(), not Traversal.properties().

gremlin> "test".properties
==>class=class java.lang.String
==>bytes=[B@5115f590
==>empty=false

However, this works:

gremlin> g.V().out().properties()
==>vp[name->lop]
==>vp[lang->java]
==>vp[name->vadas]

Yea, please provide a stack trace so I can see more information.

Thanks,
Marko.
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/ce9eef3b-4777-467f-b3ee-21e05f310da0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David

unread,
Jan 26, 2016, 6:01:49 PM1/26/16
to Gremlin-users
Stack traces appear to be similar, so here is one of them:

gremlin> graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
==>hadoopgraph[gryoinputformat->gryooutputformat]
gremlin> g = graph.traversal(computer(SparkGraphComputer))
==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], sparkgraphcomputer]

gremlin> g.V().out().in().not(__.has('name','ripple')).properties()
java.lang.NullPointerException
Display stack trace? [yN] y
java.lang.NullPointerException
    at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.getProperty(Attachable.java:236)
    at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.lambda$get$19(Attachable.java:98)
    at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method$$Lambda$98/1054035701.apply(Unknown Source)
    at org.apache.tinkerpop.gremlin.structure.util.Attachable.attach(Attachable.java:63)
    at org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ComputerResultStep.processNextStart(ComputerResultStep.java:89)
    at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:140)
    at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:147)
    at org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:205)
    at sun.reflect.GeneratedMethodAccessor74.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 org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
    at org.codehaus.groovy.tools.shell.Groovysh.setLastResult(Groovysh.groovy:443)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:218)
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:187)
    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.GeneratedMethodAccessor72.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:1210)
    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:1210)
    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:218)
    at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:144)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:218)
    at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:305)

gremlin> g.V().out('created').in('created').not(__.has('name','ripple')).values()
==>josh
==>josh
==>josh
==>josh
==>32
==>32
==>32
==>32
==>marko
==>marko
==>marko
==>29
==>29
==>29
==>peter
==>peter
==>peter
==>35
==>35
==>35
gremlin>


Marko Rodriguez

unread,
Jan 26, 2016, 8:11:03 PM1/26/16
to gremli...@googlegroups.com, d...@tinkerpop.incubator.apache.org
Hi David,

I know why this is happening, but I don't have an easy solution off the top of my head. Can you please make a JIRA ticket?

Thank you,
Marko.

David

unread,
Jan 27, 2016, 10:32:37 AM1/27/16
to Gremlin-users, d...@tinkerpop.incubator.apache.org
Reply all
Reply to author
Forward
0 new messages