Skip to content

gRPC query and streaming query ignore the language parameter (always use SQL) #3588

@robfrank

Description

@robfrank

Description

The gRPC client RemoteGrpcDatabase ignores the language parameter for query operations. Only command() correctly propagates the language to the server. This prevents using Cypher, Gremlin, OpenCypher, or any non-SQL language through the gRPC query() and queryStream() paths.

Root Cause

The bug spans three layers:

  1. Proto: ExecuteQueryRequest is missing a language field entirely, while ExecuteCommandRequest and StreamQueryRequest both have one.
  2. Client (RemoteGrpcDatabase.java): query() cannot pass language since the proto lacks the field. queryStream() never calls .setLanguage() on StreamQueryRequest despite the proto supporting it (field 7).
  3. Server (ArcadeDbGrpcService.java): executeQuery() hardcodes db.query("sql", ...). All three streamQuery modes (streamCursor, streamMaterialized, streamPaged) also hardcode "sql".

Steps to Reproduce

RemoteGrpcDatabase db = ...;
// This silently runs as SQL, ignoring "opencypher"
ResultSet rs = db.query("opencypher", "MATCH (n) RETURN n LIMIT 10");

Expected Behavior

The query should be executed using the specified language (OpenCypher in this example).

Actual Behavior

The language parameter is silently ignored and the query is always executed as SQL, which either fails or produces wrong results.

Fix

  • Add string language = 9; to ExecuteQueryRequest in the proto (additive, backward-compatible)
  • Wire the language parameter through on the client side for query(), queryStream(), and streamQuery()
  • Use the language field on the server side in executeQuery() and all streamQuery modes, defaulting to "sql" when empty

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions