Skip to content

Commit d6ca598

Browse files
authored
fix(cubesql): Do not throw error on empty peer based evaluation in window aggregates (cube-js#10776)
1 parent 6f3c031 commit d6ca598

5 files changed

Lines changed: 36 additions & 13 deletions

File tree

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 = "66a5026b7cbd77829014d122cd80056b8904c614", default-features = false, features = [
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "fc9fa63d78671bf38f31c3319302579f7c3961de", default-features = false, features = [
1414
"regex_expressions",
1515
"unicode_expressions",
1616
] }

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18697,4 +18697,19 @@ LIMIT {{ limit }}{% endif %}"#.to_string(),
1869718697
}
1869818698
)
1869918699
}
18700+
18701+
#[tokio::test]
18702+
async fn test_window_aggr_empty() -> Result<(), CubeError> {
18703+
insta::assert_snapshot!(
18704+
"window_aggr_empty",
18705+
execute_query(
18706+
"SELECT oid, COUNT(*) OVER() AS c FROM pg_class WHERE oid < 0 GROUP BY 1"
18707+
.to_string(),
18708+
DatabaseProtocol::PostgreSQL
18709+
)
18710+
.await?
18711+
);
18712+
18713+
Ok(())
18714+
}
1870018715
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
source: cubesql/src/compile/mod.rs
3+
expression: "execute_query(\"SELECT oid, COUNT(*) OVER() AS c FROM pg_class WHERE oid < 0 GROUP BY 1\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
4+
---
5+
+-----+---+
6+
| oid | c |
7+
+-----+---+
8+
+-----+---+

0 commit comments

Comments
 (0)