@@ -79,6 +79,10 @@ mod tests {
7979 #[ case( None ) ]
8080 #[ tokio:: test]
8181 async fn query_file ( #[ case] limit : Option < usize > ) -> anyhow:: Result < ( ) > {
82+ use datafusion:: functions_aggregate:: count:: count;
83+ use datafusion_expr:: Expr ;
84+ use datafusion_expr:: utils:: COUNT_STAR_EXPANSION ;
85+
8286 let session = VortexSession :: default ( ) ;
8387 let temp_dir = tempdir ( ) ?;
8488 let strings = ChunkedArray :: from_iter ( [
@@ -116,12 +120,13 @@ mod tests {
116120
117121 let ctx = SessionContext :: default ( ) ;
118122 let format = Arc :: new ( VortexFormat :: new ( session) ) ;
119- let table_url = ListingTableUrl :: parse (
120- temp_dir
121- . path ( )
122- . to_str ( )
123- . ok_or_else ( || vortex_err ! ( "Path is not valid UTF-8" ) ) ?,
124- ) ?;
123+
124+ let table_url = temp_dir
125+ . path ( )
126+ . to_str ( )
127+ . ok_or_else ( || vortex_err ! ( "Path is not valid UTF-8" ) ) ?;
128+ dbg ! ( table_url) ;
129+ let table_url = ListingTableUrl :: parse ( table_url) ?;
125130 assert ! ( table_url. is_collection( ) ) ;
126131
127132 let config = ListingTableConfig :: new ( table_url)
@@ -134,6 +139,18 @@ mod tests {
134139 let listing_table = Arc :: new ( ListingTable :: try_new ( config) ?) ;
135140
136141 ctx. register_table ( "vortex_tbl" , listing_table as _ ) ?;
142+ let count_df = ctx. table ( "vortex_tbl" ) . await ?. aggregate (
143+ vec ! [ ] ,
144+ vec ! [ count( Expr :: Literal ( COUNT_STAR_EXPANSION , None ) ) ] ,
145+ ) ?;
146+
147+ let plan = count_df. create_physical_plan ( ) . await ?;
148+ println ! (
149+ "{}" ,
150+ DisplayableExecutionPlan :: new( plan. as_ref( ) )
151+ . set_show_schema( true )
152+ . tree_render( )
153+ ) ;
137154 let total_row_count = ctx. table ( "vortex_tbl" ) . await ?. count ( ) . await ?;
138155 assert_eq ! ( total_row_count, 8 ) ;
139156
0 commit comments