Skip to content

SQL: "dijkstra" function does not accept documented arguments #1941

Description

@gramian

ArcadeDB Version 25.2.1-SNAPSHOT

The dijkstra function does not work as described, for example (SQLscript):

CREATE VERTEX TYPE V;
CREATE EDGE TYPE E;
CREATE PROPERTY E.distance LONG;

LET $src = (INSERT INTO V);
LET $dst = (INSERT INTO V);
CREATE EDGE E FROM $src TO $dst SET distance = 1;
CREATE EDGE E FROM $src TO $dst SET distance = 10;

LET $src = (SELECT FROM V LIMIT 1);
LET $dst = (SELECT FROM V LIMIT 1 SKIP 1);
SELECT dijkstra($src, $dst, 'distance') FROM V;

results in the error:

Error on command execution (PostCommandHandler): class com.arcadedb.graph.ImmutableVertex cannot be cast to class java.lang.String (com.arcadedb.graph.ImmutableVertex is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')

Similarly, using instead:

LET $src = (SELECT FROM V LIMIT 1);
LET $dst = (SELECT FROM V LIMIT 1 SKIP 1);
SELECT dijkstra($src.@rid, $dst.@rid, 'distance') FROM V;

results in the error:

Error on command execution (PostCommandHandler): class com.arcadedb.database.RID cannot be cast to class java.lang.String (com.arcadedb.database.RID is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')

So it seems the source and destination arguments for the dijkstra function are not parsed correctly.

This issue was reported by the user kyurina on Discord

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions