Skip to content

Commit 076ae0c

Browse files
authored
feat(cubesql): Coerce strings to any type in functions (#10126)
1 parent 6ce80bf commit 076ae0c

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

packages/cubejs-backend-native/Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/cubesql/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage = "https://cube.dev"
1010

1111
[dependencies]
1212
arc-swap = "1"
13-
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "48ff05841a0758bba9d69c4918f724d9515d84a6", default-features = false, features = [
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "cf034bac8babafdeb56d29a6bf75cbaa7912a8b4", default-features = false, features = [
1414
"regex_expressions",
1515
"unicode_expressions",
1616
] }

rust/cubesql/cubesql/src/compile/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18170,4 +18170,14 @@ LIMIT {{ limit }}{% endif %}"#.to_string(),
1817018170
}
1817118171
)
1817218172
}
18173+
18174+
#[tokio::test]
18175+
async fn test_coerce_string_to_number() -> Result<(), CubeError> {
18176+
insta::assert_snapshot!(
18177+
"coerce_string_to_number",
18178+
execute_query("SELECT COS('0')".to_string(), DatabaseProtocol::PostgreSQL).await?
18179+
);
18180+
18181+
Ok(())
18182+
}
1817318183
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
source: cubesql/src/compile/mod.rs
3+
expression: "execute_query(\"SELECT COS('0')\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
4+
---
5+
+----------------+
6+
| cos(Utf8("0")) |
7+
+----------------+
8+
| 1 |
9+
+----------------+

0 commit comments

Comments
 (0)