Skip to content

Commit d55c788

Browse files
MazterQyouFrank-TXS
authored andcommitted
feat(cubesql): Support DATE_PART with intervals (cube-js#9740)
Signed-off-by: Alex Qyoun-ae <[email protected]>
1 parent 0bd0e98 commit d55c788

File tree

7 files changed

+51
-25
lines changed

7 files changed

+51
-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 = "454020d6ad0eb5987aa0dbc3a3b4db8c24ccc1b5", default-features = false, features = [
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c", default-features = false, features = [
1414
"regex_expressions",
1515
"unicode_expressions",
1616
] }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
| d |
7+
+---+
8+
| 3 |
9+
+---+

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,20 @@ SELECT
112112
.unwrap()
113113
);
114114
}
115+
116+
#[tokio::test]
117+
async fn test_date_part_interval() {
118+
init_testing_logger();
119+
120+
// language=PostgreSQL
121+
let query = r#"
122+
SELECT
123+
DATE_PART('day', INTERVAL '1 year 2 month 3 day 4 hour 5 minute 6 second') AS d
124+
"#;
125+
126+
insta::assert_snapshot!(
127+
execute_query(query.to_string(), DatabaseProtocol::PostgreSQL)
128+
.await
129+
.unwrap()
130+
);
131+
}

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)