File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
vortex-datafusion/src/persistent Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ fn register_vortex_format_factory(
3232
3333#[ cfg( test) ]
3434mod tests {
35+
3536 use std:: sync:: Arc ;
3637
3738 use arrow_schema:: { DataType , Field , Schema } ;
@@ -202,7 +203,6 @@ mod tests {
202203 register_vortex_format_factory ( factory, & mut session_state_builder) ;
203204 let session = SessionContext :: new_with_state ( session_state_builder. build ( ) ) ;
204205
205- // Vortex
206206 session
207207 . sql ( & format ! (
208208 "CREATE EXTERNAL TABLE my_tbl_vx \
@@ -238,8 +238,6 @@ mod tests {
238238 let ( state, plan) = df. clone ( ) . into_parts ( ) ;
239239 let physical_plan = state. create_physical_plan ( & plan) . await ?;
240240
241- dbg ! ( physical_plan. as_ref( ) ) ;
242-
243241 insta:: assert_snapshot!( DisplayableExecutionPlan :: new( physical_plan. as_ref( ) )
244242 . tree_render( ) . to_string( ) , @r"
245243 ┌───────────────────────────┐
@@ -251,9 +249,8 @@ mod tests {
251249 ┌─────────────┴─────────────┐
252250 │ DataSourceExec │
253251 │ -------------------- │
254- │ files: 14 │
252+ │ files: 3 │
255253 │ format: vortex │
256- │ predicate: true │
257254 └───────────────────────────┘
258255 " ) ;
259256
Original file line number Diff line number Diff line change @@ -224,6 +224,14 @@ impl FileSource for VortexSource {
224224 filters : Vec < Arc < dyn PhysicalExpr > > ,
225225 _config : & ConfigOptions ,
226226 ) -> DFResult < FilterPushdownPropagation < Arc < dyn FileSource > > > {
227+ // I'm not sure why, but this is important as it doesn't return the node to the parent
228+ // which triggers a very wasteful repartition for some reason.
229+ if filters. is_empty ( ) {
230+ return Ok ( FilterPushdownPropagation :: with_parent_pushdown_result (
231+ vec ! [ ] ,
232+ ) ) ;
233+ }
234+
227235 let Some ( schema) = self . arrow_file_schema . as_ref ( ) else {
228236 return Ok ( FilterPushdownPropagation :: with_parent_pushdown_result (
229237 vec ! [ PushedDown :: No ; filters. len( ) ] ,
You can’t perform that action at this time.
0 commit comments