Skip to content

Commit b4deacd

Browse files
feat(cubesql): EXTRACT(EPOCH, ...) support (#7734)
Co-authored-by: Alex Qyoun-ae <[email protected]>
1 parent 0bc09fd commit b4deacd

File tree

5 files changed

+37
-13
lines changed

5 files changed

+37
-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 = "3c85ef6583587f5b0b037be5810e979bede9c7dc", default-features = false, features = ["regex_expressions", "unicode_expressions"] }
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "1abe9d5c7451e3d36c208801b0756fa9463f552e", default-features = false, features = ["regex_expressions", "unicode_expressions"] }
1414
anyhow = "1.0"
1515
thiserror = "1.0.50"
1616
cubeclient = { path = "../cubeclient" }

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19847,6 +19847,21 @@ limit
1984719847
);
1984819848
}
1984919849

19850+
#[tokio::test]
19851+
async fn test_tableau_extract_epoch() -> Result<(), CubeError> {
19852+
init_logger();
19853+
19854+
insta::assert_snapshot!(
19855+
"tableau_extract_epoch",
19856+
execute_query(
19857+
"SELECT EXTRACT(EPOCH FROM (TIMESTAMP '2050-01-01T23:01:01.22')) as t".to_string(),
19858+
DatabaseProtocol::PostgreSQL
19859+
)
19860+
.await?
19861+
);
19862+
Ok(())
19863+
}
19864+
1985019865
#[tokio::test]
1985119866
async fn test_thoughtspot_pg_date_trunc_year() {
1985219867
init_logger();
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 EXTRACT(EPOCH FROM (TIMESTAMP '2050-01-01T23:01:01.22')) as t\".to_string(),\n DatabaseProtocol::MySQL).await?"
4+
---
5+
+---------------+
6+
| t |
7+
+---------------+
8+
| 2524690861.22 |
9+
+---------------+

0 commit comments

Comments
 (0)