ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
496 stars 60 forks source link

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

Closed rmsloan closed 6 months ago

rmsloan commented 6 months ago

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

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 commented 6 months ago

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

lvca commented 6 months ago

Implemented.