Skip to content

Java remote client: a record returned as a projection column (Cypher RETURN a, r, b; SQL @this, first(out())) arrives as a List of RIDs and loses every property #12184

Closed

Description

@shaunpatterson

Summary

With the Java HTTP client (RemoteDatabase), a record returned as a column of a projection row (not as the whole row) comes back as a List of RIDs instead of a record. Every property of the record is lost, and an edge becomes a three element list [edge rid, in rid, out rid].

This hits ordinary Cypher such as MATCH (a)-[r]->(b) RETURN a, r, b and SQL such as SELECT @this AS me, name ... or SELECT first(out('Knows')) AS friend .... The embedded API returns the records with all their properties. A row that is itself a record (MATCH (a) RETURN a) is not affected.

Reproduction

RemoteDatabase db = new RemoteDatabase("localhost", 2480, "f1", "root", "password");
db.command("sql", "create vertex type Person");
db.command("sql", "create edge type Knows");
db.command("sql", "create vertex Person set name = 'alice', age = 30");
db.command("sql", "create vertex Person set name = 'bob', age = 40");
db.command("sql", "create edge Knows from (select from Person where name = 'alice') to (select from Person where name = 'bob') set since = 2020");

try (ResultSet rs = db.query("cypher", "MATCH (a:Person)-[r:Knows]->(b:Person) RETURN a, r, b")) {
  Result row = rs.next();
  System.out.println(row.getProperty("a")); // [#1:0]
  System.out.println(row.getProperty("r")); // [#4:0, #1:1, #1:0]
}

Measured (26.12.1-SNAPSHOT build 1541bf7, client and server from the same build)

query column remote getProperty() embedded getProperty()
MATCH (a:Person)-[r:Knows]->(b:Person) RETURN a, r, b a ArrayList[#1:0] vertex alice with name, age
same r ArrayList[#4:0, #1:1, #1:0] edge with since
same b ArrayList[#1:1] vertex bob
MATCH (a:Person {name:'alice'}) RETURN a, a.name AS n a ArrayList[#1:0] vertex alice
SELECT @this AS me, name FROM Person WHERE name = 'alice' me ArrayList[#1:0] vertex alice
SELECT first(out('Knows')) AS friend FROM Person WHERE name = 'alice' friend ArrayList[#1:1] vertex bob
MATCH (a:Person {name:'alice'}) RETURN a whole row record with all properties (correct) record

Same result with the 26.10.1 server and the 26.10.1 client jars.

Where it happens

The server sends the column as the full record plus a type hint, for example:

{"r":{"@rid":"#4:0","@type":"Knows","since":2020,"@cat":"e","@in":"#1:1","@out":"#1:0"},"a":{...},"@props":"a:11,r:11,b:11"}

11 is Type.LINK. RemoteDatabase.json2Result() applies the hint with convertWithHint(), which calls Type.convertOrKeep(null, value, Identifiable.class). Type.convert treats the Map as a multi value, iterates its values, keeps the strings that parse as RIDs (@rid, @in, @out) and drops every other value. So the record map, which the client could rebuild with json2Record() as it does for whole-row records, is turned into a list of RIDs.

[INFERENCE] A column value that carries @cat should go through json2Record() (as a nested record does for rows) before any hint conversion.

Activity

  1. added
    java
    network
    severity:major
    in progress
    on Nov 16, 2026
  2. added a commit that references this issue on Nov 16, 2026
  3. added this to the 26.12.1 milestone on Nov 16, 2026
  4. added a commit that references this issue on Nov 18, 2026
  5. self-assigned this
    on Nov 20, 2026
  6. added a commit that references this issue on Nov 20, 2026
  7. added a commit that references this issue on Nov 20, 2026
  8. lvca commented on Nov 20, 2026

    @lvca
    Member

    Fixed by #12215, ships in 26.12.1.

    With the Java HTTP client (RemoteDatabase), a record returned as one column of a row, such as a, r and b in MATCH (a)-[r]->(b) RETURN a, r, b, or SQL @this and first(out(...)), came back as a list of RIDs and lost all its properties. The server was sending the full record; the client then threw it away while applying the column's type.

    Now such a column comes back as a Document, Vertex or Edge with all its properties, the same as with the embedded API. Records inside a list, map or path column (for example collect(a)) are returned as records too. The fix is in the client only, so it works with any server version.

    If your code worked around this by reading the column as a list of RIDs, read it as a record instead and call getIdentity() when you only need the RID.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  9. removed
    in progress
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugjavanetworkopencypherseverity:majorsql

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions