Skip to content
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

EMBEDDEDMAP data type not working as expected in WHERE part of a MATCH query #8833

Closed
misu200 opened this issue Apr 1, 2019 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@misu200
Copy link

misu200 commented Apr 1, 2019

OrientDB Version: 3.0.18
Java Version: 1.8.0_181
OS: Ubuntu 16.04

It seems the SQL query parse for MATCH cant work with embeddedmap in WHERE clause

Simple test database:

create class NNode extends V;
create class EEdge extends E;

create property EEdge.series embeddedmap;
create property EEdge.name string;

let N1 = create vertex NNode set id=1;
let N2 = create vertex NNode set id=2;

create edge EEdge from $N1 to $N2 set series={"1":"one","2":"two"},name="Mike";

The following query throws an exception:
MATCH {class:NNode,as:BaseNode, where:(id=1)}.outE(){as:MyEdge,where:($currentMatch.series["1"]="one")} return $matches;

while the following working as expected:
MATCH {class:NNode,as:BaseNode, where:(id=1)}.outE(){as:MyEdge,where:($currentMatch.name="Mike")} return $matches;

The first query (embeddedmap stuff involved) throws the following server exception:

java.lang.NullPointerException
at com.orientechnologies.orient.core.sql.parser.OArraySingleValuesSelector.execute(OArraySingleValuesSelector.java:56)
at com.orientechnologies.orient.core.sql.parser.OModifier.execute(OModifier.java:89)
at com.orientechnologies.orient.core.sql.parser.OModifier.execute(OModifier.java:94)
at com.orientechnologies.orient.core.sql.parser.OBaseExpression.execute(OBaseExpression.java:109)
at com.orientechnologies.orient.core.sql.parser.OExpression.execute(OExpression.java:68)
at com.orientechnologies.orient.core.sql.parser.OBinaryCondition.evaluate(OBinaryCondition.java:44)
at com.orientechnologies.orient.core.sql.parser.ONotBlock.evaluate(ONotBlock.java:33)
at com.orientechnologies.orient.core.sql.parser.OAndBlock.evaluate(OAndBlock.java:34)
at com.orientechnologies.orient.core.sql.parser.OOrBlock.evaluate(OOrBlock.java:36)
at com.orientechnologies.orient.core.sql.parser.OAndBlock.evaluate(OAndBlock.java:34)
at com.orientechnologies.orient.core.sql.parser.OWhereClause.matchesFilters(OWhereClause.java:54)
at com.orientechnologies.orient.core.sql.executor.MatchEdgeTraverser.matchesFilters(MatchEdgeTraverser.java:302)
at com.orientechnologies.orient.core.sql.executor.MatchEdgeTraverser$1.fetchNext(MatchEdgeTraverser.java:172)
at com.orientechnologies.orient.core.sql.executor.MatchEdgeTraverser$1.hasNext(MatchEdgeTraverser.java:148)
at com.orientechnologies.orient.core.sql.executor.MatchEdgeTraverser.hasNext(MatchEdgeTraverser.java:41)
at com.orientechnologies.orient.core.sql.executor.MatchStep.fetchNext(MatchStep.java:108)
at com.orientechnologies.orient.core.sql.executor.MatchStep.access$000(MatchStep.java:13)
at com.orientechnologies.orient.core.sql.executor.MatchStep$1.hasNext(MatchStep.java:45)
at com.orientechnologies.orient.core.sql.executor.ReturnMatchPatternsStep$1.hasNext(ReturnMatchPatternsStep.java:24)
at com.orientechnologies.orient.core.sql.executor.OScriptExecutionPlan.doExecute(OScriptExecutionPlan.java:89)
at com.orientechnologies.orient.core.sql.executor.OScriptExecutionPlan.fetchNext(OScriptExecutionPlan.java:49)
at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.fetchNext(OLocalResultSet.java:35)
at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.(OLocalResultSet.java:29)
at com.orientechnologies.orient.core.command.OSqlScriptExecutor.execute(OSqlScriptExecutor.java:55)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.execute(ODatabaseDocumentEmbedded.java:619)
at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostBatch.execute(OServerCommandPostBatch.java:203)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:223)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:702)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)

@luigidellaquila luigidellaquila self-assigned this Apr 2, 2019
@luigidellaquila
Copy link
Member

Hi @misu200

Thank you very much for reporting, I'll check it ASAP

Thanks

Luigi

@luigidellaquila
Copy link
Member

Hi @misu200

I just pushed a fix, it will be in the snapshot in a few minutes and will be released with v 3.0.19

BTW, in this case you can omit $currentMatch, a simple where:(series["1"]="one") will work as well

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.19 milestone Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants