Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/cubestore/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions rust/cubestore/cubestore/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
Loading