-
-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
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:
- Proto:
ExecuteQueryRequestis missing alanguagefield entirely, whileExecuteCommandRequestandStreamQueryRequestboth have one. - Client (
RemoteGrpcDatabase.java):query()cannot pass language since the proto lacks the field.queryStream()never calls.setLanguage()onStreamQueryRequestdespite the proto supporting it (field 7). - Server (
ArcadeDbGrpcService.java):executeQuery()hardcodesdb.query("sql", ...). All threestreamQuerymodes (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;toExecuteQueryRequestin the proto (additive, backward-compatible) - Wire the language parameter through on the client side for
query(),queryStream(), andstreamQuery() - Use the language field on the server side in
executeQuery()and allstreamQuerymodes, defaulting to"sql"when empty
Reactions are currently unavailable