alamb commented on a change in pull request #1715:
URL: https://github.com/apache/arrow-datafusion/pull/1715#discussion_r800700763



##########
File path: datafusion/src/datasource/listing/table.rs
##########
@@ -118,12 +195,17 @@ impl ListingTable {
     /// The provided `schema` must be resolved before creating the table
     /// and should contain the fields of the file without the table
     /// partitioning columns.
-    pub fn new(
-        object_store: Arc<dyn ObjectStore>,
-        table_path: String,
-        file_schema: SchemaRef,
-        options: ListingOptions,
-    ) -> Self {
+    pub async fn new(mut config: ListingTableConfig) -> Result<Self> {

Review comment:
       I like this API -- it would be cool if we could add some more 
documentation (either here or in `ListingTableConfig` explaining that the 
options / schema are inferred if not explicitly created
   
   Also, as this can now return an `Err` perhaps renaming to `pub async fn 
try_new(...)` would be a more idiomatic / clearer name




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