Skip to content

NPE in geospatial query with subquery #9105

@arch7tect

Description

@arch7tect

OrientDB Version: 3.0.27

Java Version: jdk1.8.0_231

OS: windows 10

Expected behavior

Batch executes without errors

Actual behavior

NPE thrown

Steps to reproduce

drop class Country if exists unsafe;
create class Country extends V;
create property Country.name STRING;
create property Country.geometry EMBEDDED OMultiPolygon;
drop class POI if exists unsafe;
create class POI extends V;
create property POI.name STRING;
create property POI.location EMBEDDED OPoint;
insert into POI(name, location) values(“zeropoint”, St_GeomFromText(“Point(0 0)”));
insert into Country(name, geometry) values(“zeroland”, St_GeomFromText(“MultiPolygon(((1 1, 1 -1, -1 -1, -1 1, 1 1)))”));
CREATE INDEX POI.location ON POI(location) SPATIAL ENGINE LUCENE;
CREATE INDEX Country.geometry ON Country(geometry) SPATIAL ENGINE LUCENE;
let name = select name from Country where ST_Contains(geometry, (select location from POI)) = true;
return $name;

Throws exception:

java.lang.NullPointerException
at com.orientechnologies.orient.core.sql.executor.FetchFromIndexedFunctionStep.init(FetchFromIndexedFunctionStep.java:100)
at com.orientechnologies.orient.core.sql.executor.FetchFromIndexedFunctionStep.syncPull(FetchFromIndexedFunctionStep.java:38)
at com.orientechnologies.orient.core.sql.executor.FilterByClustersStep$1.fetchNextItem(FilterByClustersStep.java:57)
at com.orientechnologies.orient.core.sql.executor.FilterByClustersStep$1.hasNext(FilterByClustersStep.java:93)
at com.orientechnologies.orient.core.sql.executor.FilterByClassStep$1.fetchNextItem(FilterByClassStep.java:50)
at com.orientechnologies.orient.core.sql.executor.FilterByClassStep$1.hasNext(FilterByClassStep.java:88)
at com.orientechnologies.orient.core.sql.executor.ProjectionCalculationStep$1.hasNext(ProjectionCalculationStep.java:33)
at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.fetchNext(OLocalResultSet.java:40)
at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.(OLocalResultSet.java:30)
at com.orientechnologies.orient.core.sql.parser.OSelectStatement.execute(OSelectStatement.java:276)
at com.orientechnologies.orient.core.sql.parser.OStatement.execute(OStatement.java:79)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.command(ODatabaseDocumentEmbedded.java:567)
at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostCommand.executeStatement(OServerCommandPostCommand.java:189)
at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostCommand.execute(OServerCommandPostCommand.java:95)
at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostCommandGraph.execute(OServerCommandPostCommandGraph.java:36)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:228)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:707)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)

Query
select name from Country where ST_Contains(geometry, “POINT(0 0)”) = true
executes without errors.

Metadata

Metadata

Assignees

Labels

buglegacy not used anymore

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions