Skip to content

Commit 2629d36

Browse files
authored
feat(cubesql): Support decimal math with scalar (#9742)
Signed-off-by: Alex Qyoun-ae <[email protected]>
1 parent 65d084d commit 2629d36

File tree

7 files changed

+59
-25
lines changed

7 files changed

+59
-25
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/cubenativeutils/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 = "96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c", default-features = false, features = [
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "edbe6a8b62c1cc9f1feb0be83f089f155c662298", default-features = false, features = [
1414
"regex_expressions",
1515
"unicode_expressions",
1616
] }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
source: cubesql/src/compile/test/test_df_execution.rs
3+
expression: "execute_query(query.to_string(), DatabaseProtocol::PostgreSQL).await.unwrap()"
4+
---
5+
+--------------+
6+
| m |
7+
+--------------+
8+
| 1.0000000000 |
9+
| 1.5000000000 |
10+
+--------------+

rust/cubesql/cubesql/src/compile/test/test_df_execution.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,27 @@ async fn test_date_part_interval() {
129129
.unwrap()
130130
);
131131
}
132+
133+
#[tokio::test]
134+
async fn test_numeric_math_scalar() {
135+
init_testing_logger();
136+
137+
// language=PostgreSQL
138+
let query = r#"
139+
SELECT
140+
a % 2::numeric AS m
141+
FROM (
142+
SELECT
143+
5::numeric AS a
144+
UNION ALL
145+
SELECT
146+
3.5::numeric AS a
147+
) AS t
148+
"#;
149+
150+
insta::assert_snapshot!(
151+
execute_query(query.to_string(), DatabaseProtocol::PostgreSQL)
152+
.await
153+
.unwrap()
154+
);
155+
}

rust/cubesqlplanner/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.

0 commit comments

Comments
 (0)