Skip to content

Commit 1a39a49

Browse files
committed
fix result processing when streaming
1 parent 070c1c9 commit 1a39a49

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/cubejs-api-gateway/src/gateway.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,14 @@ class ApiGateway {
19531953
})
19541954
);
19551955

1956-
if (!request.streaming) {
1956+
if (request.streaming) {
1957+
const r = results[0];
1958+
res(await getFinalQueryResult(
1959+
r.transformDataParams,
1960+
r.rawData.isNative ? r.rawData.getNativeRef() : r.rawData,
1961+
cleanupResult(r),
1962+
));
1963+
} else {
19571964
// We prepare the final json result on native side
19581965
const [transformDataJson, rawData, resultDataJson] = (results as {
19591966
transformDataParams: any;
@@ -1969,8 +1976,6 @@ class ApiGateway {
19691976
);
19701977

19711978
res(await getFinalQueryResultArray(transformDataJson, rawData, resultDataJson));
1972-
} else {
1973-
res(results[0]);
19741979
}
19751980
}
19761981
} catch (e: any) {

0 commit comments

Comments
 (0)