-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cypher WHERE + toLower on NULL property leads to java error instead of Cypher/Gremlin error #1562
Comments
Also gave a try with latest release, same issue <ArcadeDB_0> Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandParsingException: Error on executing Cypher query
at com.arcadedb.cypher.query.CypherQueryEngine.command(CypherQueryEngine.java:80)
at com.arcadedb.database.LocalDatabase.command(LocalDatabase.java:1348)
at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:472)
at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:131)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:110)
at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:100)
at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:127)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
at org.opencypher.gremlin.traversal.CustomFunctions.lambda$cypherFunction$19(CustomFunctions.java:436)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaMapStep.map(LambdaMapStep.java:42)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.ScalarMapStep.processNextStart(ScalarMapStep.java:40)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:55)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:40)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:55)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:40)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
at org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil.test(TraversalUtil.java:141)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep.filter(TraversalFilterStep.java:63)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:41)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:55)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep.processNextStart(SelectOneStep.java:58)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:55)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.ScalarMapStep.processNextStart(ScalarMapStep.java:39)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
at com.arcadedb.gremlin.ArcadeGremlin$2.hasNext(ArcadeGremlin.java:112)
at com.arcadedb.query.sql.executor.IteratorResultSet.hasNext(IteratorResultSet.java:37)
at com.arcadedb.cypher.ArcadeCypher.execute(ArcadeCypher.java:75)
at com.arcadedb.cypher.query.CypherQueryEngine.command(CypherQueryEngine.java:77)
... 13 more
|
I see, the issue is in the open cypher's CustomFunctions class that doesn't check for nullity with arguments. Since OpenCypher's Java binding project is not active anymore, we're going to fork this class and add the fix. It's not worth it to send a PR, because I can see the project has been dead for years... |
|
Ok, all tests pass and it's pushed on |
Thanks for the fix @lvca there could be an underlying issue based on the original longer cypher request, opening another issue. |
TLDR : With cypher, if you do a query like
toLower
on all nodes but not all of them (or not any of them) got the field inside Lower it will throw a Java error.Not sure it should behave like that.
Just run
MATCH (n) WHERE toLower(n.qsdfdfsdfsdf) CONTAINS 'anything' RETURN n
on any of your DB.ArcadeDB Version:
ArcadeDB Server v24.2.1 (build ce2658d9f43625df903d593f39604003b0512bd5/1710272406173/main)
OS and JDK Version:
Running on Linux 6.5.0-27-generic - OpenJDK 64-Bit Server VM 11.0.22
Expected behavior
No error or not a Java one at least
Actual behavior
Steps to reproduce
<add here>
Original query to execute :
Reduced the query to this to reproduce the error :
The reduced query is fixed by adding
n.identity IS NOT NULL
which leads to
MATCH (n) WHERE n.identity IS NOT NULL AND toLower(n.identity) CONTAINS 'author' RETURN n
Database to toy :
mistralDB.zip
The text was updated successfully, but these errors were encountered: