orientechnologies / orientechnologies/orientdb

`OrientDB.RequestError: null` when deleting edges

Open
#10,239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Description

OrientDB Version: 3.2.30
Java Version: running in official docker image
OS: running in official docker image

Expected behavior

Trying to delete record with SQL: DELETE EDGE EDGE_NAME TO (SELECT FROM ENTITY_NAME WHERE entityId=:entityId AND integrationId=:integrationId AND type=:type)

And OrientDB deletes it, but when Im trying to run this query again he throws error

I also have index: (entityId, integrationId, type)
entityId: string
integrationId: string
type: int

lightweightEdges enabled

UPD: works well without lightweight edges

java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Objects.java:203)
        at java.util.Optional.<init>(Optional.java:96)
        at java.util.Optional.of(Optional.java:108)
        at com.orientechnologies.orient.core.sql.executor.OResultInternal.getIdentity(OResultInternal.java:330)
        at com.orientechnologies.orient.core.sql.executor.DeleteStep.mapResult(DeleteStep.java:30)
        at com.orientechnologies.orient.core.sql.executor.DeleteStep.lambda$syncPull$0(DeleteStep.java:24)
        at com.orientechnologies.orient.core.sql.executor.resultset.OResultSetMapper.next(OResultSetMapper.java:28)
        at com.orientechnologies.orient.core.sql.executor.CountStep.syncPull(CountStep.java:52)
        at com.orientechnologies.orient.core.sql.executor.OSelectExecutionPlan.fetchNext(OSelectExecutionPlan.java:35)
        at com.orientechnologies.orient.core.sql.executor.OUpdateExecutionPlan.executeInternal(OUpdateExecutionPlan.java:41)
        at com.orientechnologies.orient.core.sql.parser.ODeleteEdgeStatement.execute(ODeleteEdgeStatement.java:58)
        at com.orientechnologies.orient.core.sql.parser.ODeleteEdgeStatement.execute(ODeleteEdgeStatement.java:71)
        at com.orientechnologies.orient.core.sql.parser.OStatement.execute(OStatement.java:76)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.command(ODatabaseDocumentEmbedded.java:633)
        at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostCommand.executeStatement(OServerCommandPostCommand.java:221)
        at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostCommand.execute(OServerCommandPostCommand.java:104)
        at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostCommandGraph.execute(OServerCommandPostCommandGraph.java:34)
        at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:242)
        at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:800)
        at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:68)

Step to reproduce

  1. try to run sql query above
  2. create verticle1 with 3 fields
  3. create verticle2 with 3 fields
  4. create edge between them
  5. try to delete with sql query above

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported SQL delete-edge reproduction using lightweight edges and compare the stack-trace locations in OResultInternal.java, DeleteStep.java, and ODeleteEdgeStatement.java. Confirm that deleting the edge and repeating the query no longer raises the reported NullPointerException; the issue notes that the behavior works without lightweight edges.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.