You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rust/cubesql/cubesql/src/compile/mod.rs
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17986,6 +17986,39 @@ ORDER BY \"COUNT(count)\" DESC"
17986
17986
);
17987
17987
}
17988
17988
17989
+
#[tokio::test]
17990
+
async fn test_case_wrapper_with_limit() {
17991
+
init_logger();
17992
+
17993
+
let query_plan = convert_select_to_query_plan(
17994
+
"SELECT * FROM (SELECT CASE WHEN customer_gender = 'female' THEN 'f' ELSE 'm' END, MIN(avgPrice) mp FROM (SELECT avgPrice, customer_gender FROM KibanaSampleDataEcommerce LIMIT 1) a GROUP BY 1) q LIMIT 1123"
17995
+
.to_string(),
17996
+
DatabaseProtocol::PostgreSQL,
17997
+
)
17998
+
.await;
17999
+
18000
+
let logical_plan = query_plan.as_logical_plan();
18001
+
assert!(logical_plan
18002
+
.find_cube_scan_wrapper()
18003
+
.wrapped_sql
18004
+
.unwrap()
18005
+
.sql
18006
+
.contains("CASE WHEN"));
18007
+
18008
+
assert!(logical_plan
18009
+
.find_cube_scan_wrapper()
18010
+
.wrapped_sql
18011
+
.unwrap()
18012
+
.sql
18013
+
.contains("LIMIT 1123"));
18014
+
18015
+
let physical_plan = query_plan.as_physical_plan().await.unwrap();
0 commit comments