@@ -35,6 +35,7 @@ use datafusion::arrow::datatypes::{DataType, Schema, SchemaRef};
3535use datafusion:: catalog:: catalog:: {
3636 CatalogList , CatalogProvider , MemoryCatalogList , MemoryCatalogProvider ,
3737} ;
38+ use datafusion:: datasource:: file_format:: PhysicalPlanConfig ;
3839use datafusion:: datasource:: object_store:: local:: LocalFileSystem ;
3940use datafusion:: datasource:: object_store:: { FileMeta , ObjectStoreRegistry , SizedFile } ;
4041use datafusion:: datasource:: PartitionedFile ;
@@ -124,18 +125,22 @@ impl TryInto<Arc<dyn ExecutionPlan>> for &protobuf::PhysicalPlanNode {
124125 let statistics = convert_required ! ( scan. statistics) ?;
125126
126127 Ok ( Arc :: new ( CsvExec :: new (
127- Arc :: new ( LocalFileSystem { } ) ,
128- scan. file_groups
129- . iter ( )
130- . map ( |f| f. try_into ( ) )
131- . collect :: < Result < Vec < _ > , _ > > ( ) ?,
132- statistics,
133- schema,
128+ PhysicalPlanConfig {
129+ object_store : Arc :: new ( LocalFileSystem { } ) ,
130+ file_schema : schema,
131+ file_groups : scan
132+ . file_groups
133+ . iter ( )
134+ . map ( |f| f. try_into ( ) )
135+ . collect :: < Result < Vec < _ > , _ > > ( ) ?,
136+ statistics,
137+ projection : Some ( projection) ,
138+ batch_size : scan. batch_size as usize ,
139+ limit : scan. limit . as_ref ( ) . map ( |sl| sl. limit as usize ) ,
140+ table_partition_dims : vec ! [ ] ,
141+ } ,
134142 scan. has_header ,
135143 str_to_byte ( & scan. delimiter ) ?,
136- Some ( projection) ,
137- scan. batch_size as usize ,
138- scan. limit . as_ref ( ) . map ( |sl| sl. limit as usize ) ,
139144 ) ) )
140145 }
141146 PhysicalPlanType :: ParquetScan ( scan) => {
@@ -144,37 +149,43 @@ impl TryInto<Arc<dyn ExecutionPlan>> for &protobuf::PhysicalPlanNode {
144149 let statistics = convert_required ! ( scan. statistics) ?;
145150
146151 Ok ( Arc :: new ( ParquetExec :: new (
147- Arc :: new ( LocalFileSystem { } ) ,
148- scan. file_groups
149- . iter ( )
150- . map ( |p| p. try_into ( ) )
151- . collect :: < Result < Vec < _ > , _ > > ( ) ?,
152- statistics,
153- schema,
154- Some ( projection) ,
152+ PhysicalPlanConfig {
153+ object_store : Arc :: new ( LocalFileSystem { } ) ,
154+ file_schema : schema,
155+ file_groups : scan
156+ . file_groups
157+ . iter ( )
158+ . map ( |f| f. try_into ( ) )
159+ . collect :: < Result < Vec < _ > , _ > > ( ) ?,
160+ statistics,
161+ projection : Some ( projection) ,
162+ batch_size : scan. batch_size as usize ,
163+ limit : scan. limit . as_ref ( ) . map ( |sl| sl. limit as usize ) ,
164+ table_partition_dims : scan. table_partition_dims . clone ( ) ,
165+ } ,
155166 // TODO predicate should be de-serialized
156167 None ,
157- scan. batch_size as usize ,
158- scan. limit . as_ref ( ) . map ( |sl| sl. limit as usize ) ,
159168 ) ) )
160169 }
161170 PhysicalPlanType :: AvroScan ( scan) => {
162171 let schema = Arc :: new ( convert_required ! ( scan. schema) ?) ;
163172 let projection = scan. projection . iter ( ) . map ( |i| * i as usize ) . collect ( ) ;
164173 let statistics = convert_required ! ( scan. statistics) ?;
165174
166- Ok ( Arc :: new ( AvroExec :: new (
167- Arc :: new ( LocalFileSystem { } ) ,
168- scan. file_groups
175+ Ok ( Arc :: new ( AvroExec :: new ( PhysicalPlanConfig {
176+ object_store : Arc :: new ( LocalFileSystem { } ) ,
177+ file_schema : schema,
178+ file_groups : scan
179+ . file_groups
169180 . iter ( )
170181 . map ( |f| f. try_into ( ) )
171182 . collect :: < Result < Vec < _ > , _ > > ( ) ?,
172183 statistics,
173- schema ,
174- Some ( projection ) ,
175- scan. batch_size as usize ,
176- scan . limit . as_ref ( ) . map ( |sl| sl . limit as usize ) ,
177- ) ) )
184+ projection : Some ( projection ) ,
185+ batch_size : scan . batch_size as usize ,
186+ limit : scan. limit . as_ref ( ) . map ( |sl| sl . limit as usize ) ,
187+ table_partition_dims : vec ! [ ] ,
188+ } ) ) )
178189 }
179190 PhysicalPlanType :: CoalesceBatches ( coalesce_batches) => {
180191 let input: Arc < dyn ExecutionPlan > =
0 commit comments