File tree Expand file tree Collapse file tree 2 files changed +334
-93
lines changed
rust/cubesql/cubesql/src/compile Expand file tree Collapse file tree 2 files changed +334
-93
lines changed Original file line number Diff line number Diff line change @@ -18588,4 +18588,41 @@ LIMIT {{ limit }}{% endif %}"#.to_string(),
1858818588
1858918589 Ok(())
1859018590 }
18591+
18592+ #[tokio::test]
18593+ async fn test_double_window_aggr_sql_push_down() {
18594+ if !Rewriter::sql_push_down_enabled() {
18595+ return;
18596+ }
18597+ init_testing_logger();
18598+
18599+ let query_plan = convert_select_to_query_plan(
18600+ r#"
18601+ SELECT
18602+ customer_gender AS customer_gender,
18603+ notes AS notes,
18604+ SUM(SUM(taxful_total_price)) OVER (PARTITION BY customer_gender ORDER BY customer_gender) AS sum,
18605+ AVG(SUM(taxful_total_price)) OVER (PARTITION BY notes ORDER BY notes) AS avg
18606+ FROM KibanaSampleDataEcommerce
18607+ GROUP BY 1, 2
18608+ "#
18609+ .to_string(),
18610+ DatabaseProtocol::PostgreSQL,
18611+ )
18612+ .await;
18613+
18614+ let logical_plan = query_plan.as_logical_plan();
18615+ let sql = logical_plan
18616+ .find_cube_scan_wrapper()
18617+ .wrapped_sql
18618+ .unwrap()
18619+ .sql;
18620+ assert!(sql.contains("OVER (PARTITION BY"));
18621+
18622+ let physical_plan = query_plan.as_physical_plan().await.unwrap();
18623+ println!(
18624+ "Physical plan: {}",
18625+ displayable(physical_plan.as_ref()).indent()
18626+ );
18627+ }
1859118628}
You can’t perform that action at this time.
0 commit comments