You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/02/06 04:23:51 UTC

[GitHub] [arrow-datafusion] matthewmturner commented on a change in pull request #1715: Create ListingTableConfig which includes file format and schema inference

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



##########
File path: datafusion/src/datasource/listing/table.rs
##########
@@ -40,7 +44,70 @@ use crate::datasource::{
 
 use super::helpers::{expr_applicable_for_cols, pruned_partition_list, split_files};
 
+/// Configuration for creating a 'ListingTable'  
+pub struct ListingTableConfig {
+    pub object_store: Arc<dyn ObjectStore>,
+    pub table_path: String,
+    pub file_schema: Option<SchemaRef>,
+    pub options: Option<ListingOptions>,
+}
+
+impl ListingTableConfig {
+    /// Creates new `ListingTableConfig`.  The `SchemaRef` and `ListingOptions` are inferred based on the suffix of the provided `table_path`.
+    pub async fn new(
+        object_store: Arc<dyn ObjectStore>,
+        table_path: impl Into<String>,
+    ) -> Self {
+        Self {
+            object_store,
+            table_path: table_path.into(),
+            file_schema: None,
+            options: None,
+        }
+    }
+    pub fn with_schema(mut self, schema: SchemaRef) {

Review comment:
       Thx @houqp.  FYI, i made updates and im planning on updating the remaining errors next.  Lmk if you see anything else.




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org