diff --git a/rust/cubestore/Cargo.lock b/rust/cubestore/Cargo.lock index 6bb0ab21a3da3..2bee7bd4b5925 100644 --- a/rust/cubestore/Cargo.lock +++ b/rust/cubestore/Cargo.lock @@ -1367,7 +1367,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "datafusion" version = "4.0.0-SNAPSHOT" -source = "git+https://github.com/cube-js/arrow-datafusion?branch=cube#00eb928a70c29ba45525cd5e566fd7e95192928e" +source = "git+https://github.com/cube-js/arrow-datafusion?branch=cube#735f2cb8051be9f196a3fdb09005c6e939dab1aa" dependencies = [ "ahash", "arrow", diff --git a/rust/cubestore/cubestore/src/sql/mod.rs b/rust/cubestore/cubestore/src/sql/mod.rs index 80016639cfe5e..7ac801ff8a587 100644 --- a/rust/cubestore/cubestore/src/sql/mod.rs +++ b/rust/cubestore/cubestore/src/sql/mod.rs @@ -3922,6 +3922,34 @@ mod tests { }).await; } + #[tokio::test] + async fn builtin_functions() { + Config::run_test("builtin_functions", async move |services| { + let service = services.sql_service; + + // ROUND + { + let result = service + .exec_query("SELECT round(42.4), round(42.4382, 2), round(1234.56, -1)") + .await + .unwrap(); + + assert_eq!(result.len(), 1); + assert_eq!(result.get_columns().len(), 3); + + assert_eq!( + result.get_rows(), + &vec![Row::new(vec![ + TableValue::Float(42.0.into()), + TableValue::Float(42.44.into()), + TableValue::Float(1230.0.into()) + ]),] + ) + } + }) + .await; + } + #[tokio::test] async fn explain_physical_plan() { Config::test("explain_analyze_router").update_config(|mut config| {