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/10/30 15:20:05 UTC

[GitHub] [arrow-datafusion] andygrove opened a new pull request, #4033: Add some validation to ListingTable to verify that at least one file exists

andygrove opened a new pull request, #4033:
URL: https://github.com/apache/arrow-datafusion/pull/4033

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes https://github.com/apache/arrow-datafusion/issues/1736
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   It is very frustrating to get incorrect query results when trying to query csv files with a non-csv extension such as `.tbl` or `.tsv`.
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Add some validation that files exists
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


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


[GitHub] [arrow-datafusion] tustvold commented on a diff in pull request #4033: Add some validation to ListingTable to verify that at least one file exists

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #4033:
URL: https://github.com/apache/arrow-datafusion/pull/4033#discussion_r1008935661


##########
datafusion/core/src/datasource/listing/table.rs:
##########
@@ -443,6 +443,20 @@ impl ListingTable {
         let store = ctx
             .runtime_env
             .object_store(&self.table_paths.get(0).unwrap())?;
+
+        let mut count = 0;
+        for table_path in &self.table_paths {
+            let stream = table_path.list_all_files(store.as_ref(), &self.options.file_extension);
+            let mut all_files = Box::pin(stream.fuse());
+            while let Some(res) = all_files.next().await {

Review Comment:
   Why not short-circuit on the first file?



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


[GitHub] [arrow-datafusion] andygrove commented on pull request #4033: Add some validation to ListingTable to verify that at least one file exists

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #4033:
URL: https://github.com/apache/arrow-datafusion/pull/4033#issuecomment-1313968391

   > It seems strange to me that you specify the file is a CSV file, and then it also cares about the extension.
   
   One of the motivations may have been to handle the Spark case, where directories may contain a `_SUCCESS` file alongside the actual data files.


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


[GitHub] [arrow-datafusion] andygrove commented on pull request #4033: Add some validation to ListingTable to verify that at least one file exists

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #4033:
URL: https://github.com/apache/arrow-datafusion/pull/4033#issuecomment-1297109947

   > I do wonder if we should just remove the filtering based on file extension
   
   I would much prefer that. I will update this PR to use that approach instead.


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


[GitHub] [arrow-datafusion] andygrove commented on pull request #4033: Add some validation to ListingTable to verify that at least one file exists

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #4033:
URL: https://github.com/apache/arrow-datafusion/pull/4033#issuecomment-1296283991

   @tustvold Would be good to get some feedback on the approach here before I add tests.


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


[GitHub] [arrow-datafusion] andygrove closed pull request #4033: Add some validation to ListingTable to verify that at least one file exists

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed pull request #4033: Add some validation to ListingTable to verify that at least one file exists
URL: https://github.com/apache/arrow-datafusion/pull/4033


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