Skip to content

Commit 6f2bf64

Browse files
committed
fix(backend-native): Fix result wrapper parsing
1 parent f354570 commit 6f2bf64

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/cubejs-backend-native/src/orchestrator.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ impl ValueObject for ResultWrapper {
184184
DBResponsePrimitive::String(s) => FieldValue::String(Cow::Borrowed(s)),
185185
DBResponsePrimitive::Number(n) => FieldValue::Number(*n),
186186
DBResponsePrimitive::Boolean(b) => FieldValue::Bool(*b),
187+
DBResponsePrimitive::Uncommon(v) => FieldValue::String(Cow::Owned(
188+
serde_json::to_string(&v).unwrap_or_else(|_| v.to_string()),
189+
)),
187190
DBResponsePrimitive::Null => FieldValue::Null,
188191
})
189192
}

rust/cubeorchestrator/src/query_result_transform.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ pub enum DBResponsePrimitive {
621621
Boolean(bool),
622622
Number(f64),
623623
String(String),
624+
Uncommon(Value),
624625
}
625626

626627
impl Display for DBResponsePrimitive {
@@ -630,6 +631,9 @@ impl Display for DBResponsePrimitive {
630631
DBResponsePrimitive::Boolean(b) => b.to_string(),
631632
DBResponsePrimitive::Number(n) => n.to_string(),
632633
DBResponsePrimitive::String(s) => s.clone(),
634+
DBResponsePrimitive::Uncommon(v) => {
635+
serde_json::to_string(&v).unwrap_or_else(|_| v.to_string())
636+
}
633637
};
634638
write!(f, "{}", str)
635639
}

0 commit comments

Comments
 (0)