Re: throw NullPointerException when query with hasLabel() script
阳生丙 <ouyang....@...>
to HadoopMarc:
it is not about double quote. the problem is: when gremlin script contains hasLabel() clause, janus server will throws NullPointerException.
i use console and gremlin driver to fire these query to remote janusgraph server.
在2020年11月28日星期六 UTC+8 上午2:48:23<HadoopMarc> 写道:
Hi,Do you mean that the only difference between the first and the second script is the presence of the closing double quote? I see the stacktrace is from Gremlin Server: did you use Gremlin Console to fire the query? What happens if you make a GLV/bytecode connection instead of a connection for groovy scripts, that is using:g = traversal().withRemote(DriverRemoteConnection.using("localhost",8182,"g"))Best wishes, MarcOp vrijdag 27 november 2020 om 19:05:24 UTC+1 schreef ouy...@...:query with gremlin script: "g.E().hasLabel('L2_LINK').has('prop1', 'prop1-value')"the returned result is expected and correct.but query with gremlin script: "g.E().hasLabel('L2_LINK').has('prop1', 'prop1-value')throws NullPointerException.the exception stack info is as follow:2020-11-27 12:07:35,227 WARN [gremlin-server-exec-10] AbstractEvalOpProcessor.java:311 - Exception processing a script on request [RequestMessage{, requestId=cb1f0ab6-cee6-47c4-bbc1-196f27b1b14c, op='eval', processor='', args={gremlin=g.E().hasLabel('L2_LINK').has('prop1', 'prop1-value'), batchSize=64}}].java.lang.NullPointerExceptionat org.janusgraph.graphdb.util.ElementHelper.getValues(ElementHelper.java:41)at org.janusgraph.graphdb.query.condition.PredicateCondition.evaluate(PredicateCondition.java:68)at org.janusgraph.graphdb.query.condition.And.evaluate(And.java:55)at org.janusgraph.graphdb.query.graph.GraphCentricQuery.matches(GraphCentricQuery.java:153)at org.janusgraph.graphdb.query.QueryProcessor.lambda$getFilterIterator$2(QueryProcessor.java:133)at com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)at org.janusgraph.graphdb.query.ResultSetIterator.nextInternal(ResultSetIterator.java:54)at org.janusgraph.graphdb.query.ResultSetIterator.next(ResultSetIterator.java:67)at org.janusgraph.graphdb.query.ResultSetIterator.next(ResultSetIterator.java:28)at com.google.common.collect.Iterators$7.computeNext(Iterators.java:651)at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)at com.google.common.collect.Iterators$5.hasNext(Iterators.java:547)at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)at org.janusgraph.graphdb.util.MultiDistinctOrderedIterator.hasNext(MultiDistinctOrderedIterator.java:75)at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:149)at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:197)at org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.handleIterator(AbstractOpProcessor.java:146)at org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.lambda$evalOpInternal$5(AbstractEvalOpProcessor.java:264)at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:278)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:748)and the problem is reproducible, is it a bug?enviroment:janusgraph version: 0.5.2backend cassandra version: 3.11