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

RemoteVertex.newEdge does not support Map properties, while GraphEntity.newEdge does #1569

Closed
rmsloan opened this issue Apr 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working fixed
Milestone

Comments

@rmsloan
Copy link

rmsloan commented Apr 26, 2024

ArcadeDB Version:

ArcadeDB Server v24.4.1

OS and JDK Version:

Running on Linux 4.18.0-477.21.1.el8_8.x86_64 - OpenJDK 64-Bit Server VM 11.0.22 (Temurin-11.0.22+7)

Expected behavior

`Expected all implementations of Vertex.newEdge(..., final Object... properties) to support both

  • Map
  • or
  • array or sequence of arguments
    for properties. `

Actual behavior

Success case (embedded):

GraphEngine.newEdge(...) employs its setProperties method which handles properties provided to it as a Map OR array of arguments (Properties must be an even number as pairs of name, value).

Failure case (remote):

RemoteVertex.newEdge(...) expects only an array of arguments.
Properties provided as a Map results in an Exception at line 143.
class java.util.HashMap cannot be cast to class java.lang.String (java.util.HashMap and java.lang.String)

Steps to reproduce

db is a RemoteDatabase

  db.transaction( () -> {
    MutableVertex elon = db.newVertex("User", "name", "Elon", "lastName", "Musk").save();
    MutableVertex steve = db.newVertex("User", "name", "Steve", "lastName", "Jobs").save();
    Map<String, Object> properties = new HashMap();
    properties.put("since", 2010);
    properties.put("Map", "would like to be supported in RemoteVertex, just like it's buddy GraphEngine ;-)");
    elon.newEdge("IsFriendOf", steve, true, properties);
  });
@lvca lvca self-assigned this Apr 27, 2024
@lvca lvca added the bug Something isn't working label Apr 27, 2024
@lvca lvca added this to the 24.5.1 milestone Apr 27, 2024
@lvca
Copy link
Contributor

lvca commented Apr 27, 2024

Confirmed, the support for passing a map is totally missing in the remote vertex. Fixing it.

@lvca
Copy link
Contributor

lvca commented Apr 27, 2024

Implemented.

@lvca lvca closed this as completed Apr 27, 2024
@lvca lvca added the fixed label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants