cetra3 opened a new issue, #21191:
URL: https://github.com/apache/datafusion/issues/21191

   ### Is your feature request related to a problem or challenge?
   
   Right now, the `PartitionedFile` has an extensions field that is an optional 
type erased value:
   
   ```rust
   pub struct PartitionedFile {
       // other fields
       pub extensions: Option<Arc<dyn std::any::Any + Send + Sync>>,
   }
   ```
   
   This means you can only store *one* value in the extension.
   
   *other* parts of Datafusion that use this pattern use a type map, like 
`SessionConfig`:
   
   ```rust
   #[derive(Clone, Debug)]
   pub struct SessionConfig {
       extensions: AnyMap,
   }
   ```
   
   
   Further to this, [the machinery in the parquet 
opener](https://github.com/pydantic/datafusion/blob/80b80680ffd327036530c87580010fce930226f2/datafusion/datasource-parquet/src/opener.rs#L920),
 if we want to provide an access plan, *needs* this value to be a 
`ParquetAccessPlan`:
   
   ```rust
           if let Some(access_plan) = 
extensions.downcast_ref::<ParquetAccessPlan>() {
               let plan_len = access_plan.len();
               if plan_len != row_group_count {
                   return exec_err!(
                       "Invalid ParquetAccessPlan for {file_name}. Specified 
{plan_len} row groups, but file has {row_group_count}"
                   );
               }
   
               // check row group count matches the plan
               return Ok(access_plan.clone());
           }
   ```
   
   This means you can't actually provide any other values within the extensions 
field, if you want to pre-provide your access plans.
   
   ### Describe the solution you'd like
   
   `PartitionedFile` should include a type map in it:
   
   ```rust
   pub struct PartitionedFile {
       // other fields
       pub extensions: AnyMap
   }
   ```
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to