Skip to content

gRPC Java client: Cypher MATCH (n) RETURN n (and SQL SELECT @this) yields a vertex whose only property is "n", so vertex.get("name") is null #12196

Closed

Description

@shaunpatterson

Summary

Over the gRPC Java client (RemoteGrpcDatabase.query()), a row that the engine answers as an element plus a projection, such as Cypher MATCH (n:Person) RETURN n or SQL SELECT @rid, @type, @this FROM ..., arrives as a vertex whose only property is the projection alias (n or @this) holding the record as a map. vertex.get("name") is null and getPropertyNames() is [n]. The HTTP client and the embedded API return the vertex with its own properties (name, age).

Also, rows with several record columns (RETURN a, r, b) give each column as a raw Map with @rid/@cat keys rather than a record (the HTTP client has its own, different, wrong shape for those: #12184).

Reproduction

RemoteGrpcServer server = new RemoteGrpcServer("localhost", 50051, "root", "password", true, List.of());
RemoteGrpcDatabase db = new RemoteGrpcDatabase(server, "localhost", 50051, 2480, "g1", "root", "password");
db.command("sql", "create vertex type Person");
db.command("sql", "create vertex Person set name = 'alice', age = 30");

Result r = db.query("cypher", "MATCH (n:Person {name:'alice'}) RETURN n").next();
r.isVertex();                                  // true
r.getVertex().get().get("name");               // null
r.getVertex().get().getPropertyNames();        // [n]
r.getVertex().get().get("n");                  // {@rid=#1:0, @type=Person, name=alice, age=30, @cat=v}

Measured (server and gRPC client from 26.12.1-SNAPSHOT 1541bf7; identical on 26.10.1)

query gRPC: element getPropertyNames() gRPC: get("name") HTTP client embedded
MATCH (n:Person {name:'alice'}) RETURN n [n] null vertex, [name, age], alice vertex, [name, age], alice
SELECT @rid, @type, @this FROM Person WHERE name = 'alice' [@this] null row with @rid, @type, @this row with @rid, @type, @this (vertex)
SELECT FROM Person WHERE name = 'alice' [name, age] alice same same
MATCH (a)-[r:Knows]->(b) RETURN a, r, b not an element; a, r, b are LinkedHashMap {@rid=..., @cat=v, ...} n/a a, r, b are lists of RIDs (#12184) vertices and edge

Where it happens

ArcadeDbGrpcService.convertResultToGrpcRecord() (grpcw) sets the GrpcRecord's rid/type from result.toElement() when result.isElement(), but fills properties from result.getPropertyNames(), which for these results are the projection aliases (n, or @rid/@type/@this), not the element's properties. RemoteGrpcDatabase.grpcRecordToDBRecord() then sees a rid, a type and @cat=v and builds a RemoteImmutableVertex from those alias properties (@rid/@type are dropped as metadata, which is why only @this is left in the SQL case). The HTTP JsonSerializer serializes the element itself for the same Result.

Activity

  1. added
    grpc
    severity:major
    in progress
    on Nov 16, 2026
  2. added this to the 26.12.1 milestone on Nov 16, 2026
  3. self-assigned this
    on Nov 18, 2026
  4. added 3 commits that reference this issue on Nov 18, 2026
  5. lvca commented on Nov 18, 2026

    @lvca
    Member

    Fixed by #12226, shipping in 26.12.1.

    What was wrong: over the gRPC Java client, a query that returns a whole record, such as MATCH (n:Person) RETURN n, gave back a vertex whose only property was n, so get("name") answered null. SELECT @rid, @type, @this had the same problem with @this. Rows with several record columns (RETURN a, r, b) gave each column as a raw Map instead of a record.

    What changes for you: gRPC results now have the same shape as the embedded API:

    • RETURN n returns the vertex or edge with its own properties (name, age).
    • A column that holds a record (RETURN a, r, b, SQL @this, each record inside collect(n)) is a Document, Vertex or Edge, not a Map.
    • The columns of a projection keep the order of the query.

    If your code worked around the bug by reading vertex.get("n") or by casting a record column to Map, change it to read the record directly. Note that a map your query builds with a valid @rid and the name of an existing type as @type is now also returned as a record.

    The HTTP Java client has its own, different problem with record columns. That one is tracked in #12184.


    ❤️ 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.

  6. removed
    in progress
    on Nov 18, 2026
  7. added a commit that references this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggrpcopencypherseverity:majorsql

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions