Skip to content

Commit 937f256

Browse files
committed
fix: only fall back to listing prefixes on 404 errors
This logic would previously swallow all errors, including things like DNS resolution failures. If the path was indeed a path and not a prefix, that would result in the path being dropped, since the prefix wouldn't include any further files. Fixes #18242.
1 parent 408e1e4 commit 937f256

File tree

1 file changed

+4
-1
lines changed
  • datafusion/datasource/src

1 file changed

+4
-1
lines changed

datafusion/datasource/src/url.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ impl ListingTableUrl {
252252
.boxed(),
253253
// If the head command fails, it is likely that object doesn't exist.
254254
// Retry as though it were a prefix (aka a collection)
255-
Err(_) => list_with_cache(ctx, store, &self.prefix).await?,
255+
Err(object_store::Error::NotFound { .. }) => {
256+
list_with_cache(ctx, store, &self.prefix).await?
257+
}
258+
Err(e) => return Err(e.into()),
256259
}
257260
};
258261

0 commit comments

Comments
 (0)