From f5425ffb9c61c0dd7c40b5b796155da6c1170a26 Mon Sep 17 00:00:00 2001 From: Konstantin Burkalev Date: Wed, 18 Dec 2024 17:16:41 +0200 Subject: [PATCH] =?UTF-8?q?edits=20in=20result=20processing=20when=C2=A0st?= =?UTF-8?q?reaming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cubejs-api-gateway/src/gateway.ts | 6 +++--- rust/cubeorchestrator/src/transport.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cubejs-api-gateway/src/gateway.ts b/packages/cubejs-api-gateway/src/gateway.ts index 65132abcb4434..084de7d916bf0 100644 --- a/packages/cubejs-api-gateway/src/gateway.ts +++ b/packages/cubejs-api-gateway/src/gateway.ts @@ -1953,7 +1953,9 @@ class ApiGateway { }) ); - if (!request.streaming) { + if (request.streaming) { + res(results[0]); + } else { // We prepare the final json result on native side const [transformDataJson, rawData, resultDataJson] = (results as { transformDataParams: any; @@ -1969,8 +1971,6 @@ class ApiGateway { ); res(await getFinalQueryResultArray(transformDataJson, rawData, resultDataJson)); - } else { - res(results[0]); } } } catch (e: any) { diff --git a/rust/cubeorchestrator/src/transport.rs b/rust/cubeorchestrator/src/transport.rs index e7cf56044a4b2..5bcd358a28a40 100644 --- a/rust/cubeorchestrator/src/transport.rs +++ b/rust/cubeorchestrator/src/transport.rs @@ -84,7 +84,7 @@ pub struct GroupingSet { // We can do nothing with JS functions here, // but to keep DTOs in sync with reality, let's keep it. -type JsFunction = String; +pub type JsFunction = String; #[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)] #[serde(rename_all = "camelCase")]