Skip to content

Commit 5870bf9

Browse files
committed
feat(cubestore): Support two arguments for round, fix #6179
1 parent e401cb6 commit 5870bf9

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

rust/cubestore/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubestore/cubestore/src/sql/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,6 +3922,34 @@ mod tests {
39223922
}).await;
39233923
}
39243924

3925+
#[tokio::test]
3926+
async fn builtin_functions() {
3927+
Config::run_test("builtin_functions", async move |services| {
3928+
let service = services.sql_service;
3929+
3930+
// ROUND
3931+
{
3932+
let result = service
3933+
.exec_query("SELECT round(42.4), round(42.4382, 2), round(1234.56, -1)")
3934+
.await
3935+
.unwrap();
3936+
3937+
assert_eq!(result.len(), 3);
3938+
assert_eq!(result.get_columns().len(), 1);
3939+
3940+
assert_eq!(
3941+
result.get_rows(),
3942+
&vec![
3943+
Row::new(vec![TableValue::Float(42_0.into())]),
3944+
Row::new(vec![TableValue::Float(42.44.into())]),
3945+
Row::new(vec![TableValue::Float(1230_0.into())]),
3946+
]
3947+
)
3948+
}
3949+
})
3950+
.await;
3951+
}
3952+
39253953
#[tokio::test]
39263954
async fn explain_physical_plan() {
39273955
Config::test("explain_analyze_router").update_config(|mut config| {

0 commit comments

Comments
 (0)