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 22:23:56 UTC
[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
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