You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2023/06/09 11:45:32 UTC

[arrow-datafusion] branch main updated: fix: avoid panic in `list_files_for_scan` (#6605)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 1a1efcf726 fix: avoid panic in `list_files_for_scan` (#6605)
1a1efcf726 is described below

commit 1a1efcf7261335f1d7814be9fbb2eb455aba7e54
Author: Folyd <ly...@gmail.com>
AuthorDate: Fri Jun 9 19:45:26 2023 +0800

    fix: avoid panic in `list_files_for_scan` (#6605)
---
 datafusion/core/src/datasource/listing/table.rs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/datafusion/core/src/datasource/listing/table.rs b/datafusion/core/src/datasource/listing/table.rs
index b11fa8b063..b0bdc05244 100644
--- a/datafusion/core/src/datasource/listing/table.rs
+++ b/datafusion/core/src/datasource/listing/table.rs
@@ -828,9 +828,11 @@ impl ListingTable {
         filters: &'a [Expr],
         limit: Option<usize>,
     ) -> Result<(Vec<Vec<PartitionedFile>>, Statistics)> {
-        let store = ctx
-            .runtime_env()
-            .object_store(self.table_paths.get(0).unwrap())?;
+        let store = if let Some(url) = self.table_paths.get(0) {
+            ctx.runtime_env().object_store(url)?
+        } else {
+            return Ok((vec![], Statistics::default()));
+        };
         // list files (with partitions)
         let file_list = future::try_join_all(self.table_paths.iter().map(|table_path| {
             pruned_partition_list(