neo4j/community — Issue #106: Error on try use SKIP or LIMIT on null result cypher query
Author: gustavoboby
Created: 2011-11-16 16:19:03+00:00
State: open

Hi people's,

On i try to execute this query:
{"query": "start x = node:my_auto_index(Type='Perfil') match (n)-[rp:Postou]-(x)-[rc:Adicionou]->() where rc.StatusConvite = 'Aceito' AND x.Email = 'Tester51@grupoec.com.br' return distinct n SKIP 0 LIMIT 20 " }

Was returned this error:

==> 500 Internal Server Error
==> {
==> "exception" : "java.util.NoSuchElementException",
==> "stacktrace" : [ "scala.collection.TraversableLike$$anonfun$2.apply(TraversableLike.scala:372)", "scala.collection.TraversableLike$$anonfun$2.apply(TraversableLike.scala:372)", "scala.collection.TraversableLike$class.head(TraversableLike.scala:379)", "org.neo4j.cypher.pipes.Pipe.head(Pipe.scala:31)", "org.neo4j.cypher.pipes.SlicePipe.foreach(SlicePipe.scala:30)", "org.neo4j.cypher.pipes.ColumnFilterPipe.foreach(ColumnFilterPipe.scala:35)", "scala.collection.TraversableLike$class.map(TraversableLike.scala:194)", "org.neo4j.cypher.pipes.Pipe.map(Pipe.scala:31)", "org.neo4j.cypher.ExecutionResult$class.javaIterator(ExecutionResult.scala:49)", "org.neo4j.cypher.pipes.ColumnFilterPipe.javaIterator(ColumnFilterPipe.scala:25)", "org.neo4j.cypher.javacompat.ExecutionResult.iterator(ExecutionResult.java:51)", "org.neo4j.server.rest.repr.CypherResultRepresentation.data(CypherResultRepresentation.java:54)", "sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)", "java.lang.reflect.Method.invoke(Unknown Source)", "org.neo4j.server.rest.repr.ObjectRepresentation$1.get(ObjectRepresentation.java:92)", "org.neo4j.server.rest.repr.ObjectRepresentation$PropertyGetter.putTo(ObjectRepresentation.java:131)", "org.neo4j.server.rest.repr.ObjectRepresentation.serialize(ObjectRepresentation.java:143)", "org.neo4j.server.rest.repr.MappingRepresentation.serialize(MappingRepresentation.java:42)", "org.neo4j.server.rest.repr.OutputFormat.format(OutputFormat.java:123)", "org.neo4j.server.rest.repr.OutputFormat.response(OutputFormat.java:100)", "org.neo4j.server.rest.repr.OutputFormat.ok(OutputFormat.java:48)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)", "java.lang.reflect.Method.invoke(Unknown Source)", "com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)", "com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)", "com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)", "com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)", "com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)", "javax.servlet.http.HttpServlet.service(HttpServlet.java:820)", "org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)", "org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)", "org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)", "org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)", "org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)", "org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)", "org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)", "org.mortbay.jetty.Server.handle(Server.java:326)", "org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)", "org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)", "org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)", "org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)", "org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)", "org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)", "org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)" ]
==> }
http>

But was suposed to be need return a null data and not a exception

If i remove the SKIP and LIMIT this query work's, but is not usual