Skip to content

Commit 3226a63

Browse files
authored
feat(cubestore): Support Arrow IPC response format (cube-js#10819)
Clients can opt in via `HttpQuery.response_format = Arrow` to receive results as a binary Arrow IPC stream wrapped in a new `HttpQueryResult` flatbuffer variant, instead of the legacy `HttpResultSet` where every cell is stringified. Default stays `Legacy`, so existing clients that don't set the flag keep getting `HttpResultSet` — no behavior change for them.
1 parent 4d3bcbe commit 3226a63

10 files changed

Lines changed: 1074 additions & 55 deletions

File tree

rust/cube/cubeshared/src/codegen/http_message.fbs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
union HttpCommand {
22
HttpQuery,
33
HttpResultSet,
4-
HttpError
4+
HttpError,
5+
HttpQueryResult
56
}
67

78
table HttpMessage {
@@ -22,11 +23,18 @@ table HttpParameter {
2223
value: HttpParameterValue (required);
2324
}
2425

26+
enum QueryResultFormat: ubyte {
27+
// HttpResultSet will be returned.
28+
Legacy = 0,
29+
Arrow = 1,
30+
}
31+
2532
table HttpQuery {
2633
query: string;
2734
trace_obj: string;
2835
inline_tables: [HttpTable];
2936
parameters: [HttpParameter];
37+
response_format: QueryResultFormat = Legacy;
3038
}
3139

3240
table HttpTable {
@@ -54,4 +62,21 @@ table HttpColumnValue {
5462
string_value: string;
5563
}
5664

65+
table HttpQueryResultArrow {
66+
// Self-contained Arrow IPC stream payload. Contains a schema header
67+
// followed by one or more RecordBatch messages. Consumers must use a
68+
// streaming IPC reader (not assume a single batch).
69+
data: [ubyte] (required);
70+
// True on the final frame of a streamed result.
71+
is_last: bool;
72+
}
73+
74+
union HttpQueryResultData {
75+
HttpQueryResultArrow,
76+
}
77+
78+
table HttpQueryResult {
79+
data: HttpQueryResultData (required);
80+
}
81+
5782
root_type HttpMessage;

0 commit comments

Comments
 (0)