File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
rust/cubesql/cubesql/src/compile/test Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1417,3 +1417,41 @@ async fn wrapper_agg_dimension_over_limit() {
14171417 . sql
14181418 . contains( "\" ungrouped\" : true" ) ) ;
14191419}
1420+
1421+ /// Simple wrapper with cast should have explicit members, not zero
1422+ #[ tokio:: test]
1423+ async fn wrapper_cast_limit_explicit_members ( ) {
1424+ if !Rewriter :: sql_push_down_enabled ( ) {
1425+ return ;
1426+ }
1427+ init_testing_logger ( ) ;
1428+
1429+ let query_plan = convert_select_to_query_plan (
1430+ // language=PostgreSQL
1431+ r#"
1432+ SELECT
1433+ CAST(dim_date0 AS DATE) AS "dim_date0"
1434+ FROM
1435+ MultiTypeCube
1436+ LIMIT 10
1437+ ;
1438+ "#
1439+ . to_string ( ) ,
1440+ DatabaseProtocol :: PostgreSQL ,
1441+ )
1442+ . await ;
1443+
1444+ let physical_plan = query_plan. as_physical_plan ( ) . await . unwrap ( ) ;
1445+ println ! (
1446+ "Physical plan: {}" ,
1447+ displayable( physical_plan. as_ref( ) ) . indent( )
1448+ ) ;
1449+
1450+ // Query should mention just a single member
1451+ let request = query_plan
1452+ . as_logical_plan ( )
1453+ . find_cube_scan_wrapped_sql ( )
1454+ . request ;
1455+ assert_eq ! ( request. measures. unwrap( ) . len( ) , 1 ) ;
1456+ assert_eq ! ( request. dimensions. unwrap( ) . len( ) , 0 ) ;
1457+ }
You can’t perform that action at this time.
0 commit comments