alamb commented on issue #1705:
URL: 
https://github.com/apache/arrow-datafusion/issues/1705#issuecomment-1025115375


   > @alamb @houqp @seddonm1 what do you think about this proposal?
   
   
   I think the usecase of defaulting schema and format makes a lot of sense
   
   If you are going to change the signature of `ListingTable` perhaps it would 
be worth using a builder / config (so that future changes don't require another 
signature change):
   
   Something like 
   ```rust
   struct ListingTableConfig {
     object_store: Arc<dyn ObjectStore>, 
     table_path: String, 
     file_schema: Option<SchemaRef>, 
     options: Option<ListingOptions>
   }
   
   impl LIstingTableConfig {
     fn new(object_store: Arc<dyn ObjectStore>, table_path: impl Into<String>) 
-> Self {
       ..
     }
   
     fn with_schema(mut self, schema: SchemaRef) -> Self {
     ...
     }
   
     fn with_options(mut self, listing_options: ListingOptions) -> Self {
     ..
     }
   }
   
   ```
   
   And then your example could look like
   
   ```rust
   let config = ListingTableConfig::new(
     object_store,
     "data/alltypes_plain.snappy.parquet"
   );
     
   
   let table = ListingTable::new(config);
   ```
   
   


-- 
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]


Reply via email to