File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
rust/cubesql/cubesql/src/compile/test Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -1205,3 +1205,38 @@ async fn wrapper_agg_dimension_over_limit() {
12051205 . sql
12061206 . contains( "\" ungrouped\" :true" ) ) ;
12071207}
1208+
1209+ /// Aggregation with falsy filter should NOT get pushed to CubeScan with limit=0
1210+ #[ tokio:: test]
1211+ async fn select_agg_where_false ( ) {
1212+ if !Rewriter :: sql_push_down_enabled ( ) {
1213+ return ;
1214+ }
1215+ init_testing_logger ( ) ;
1216+
1217+ let query_plan = convert_select_to_query_plan (
1218+ "SELECT SUM(sumPrice) FROM KibanaSampleDataEcommerce WHERE 1 = 0" . to_string ( ) ,
1219+ DatabaseProtocol :: PostgreSQL ,
1220+ )
1221+ . await ;
1222+
1223+ let physical_plan = query_plan. as_physical_plan ( ) . await . unwrap ( ) ;
1224+ println ! (
1225+ "Physical plan: {}" ,
1226+ displayable( physical_plan. as_ref( ) ) . indent( )
1227+ ) ;
1228+
1229+ let logical_plan = query_plan. as_logical_plan ( ) ;
1230+ assert_eq ! (
1231+ logical_plan. find_cube_scan( ) . request,
1232+ V1LoadRequestQuery {
1233+ measures: Some ( vec![ ] ) ,
1234+ segments: Some ( vec![ ] ) ,
1235+ dimensions: Some ( vec![ ] ) ,
1236+ order: Some ( vec![ ] ) ,
1237+ limit: None ,
1238+ ungrouped: Some ( true ) ,
1239+ ..Default :: default ( )
1240+ }
1241+ ) ;
1242+ }
You can’t perform that action at this time.
0 commit comments