Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion/core/src/execution/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ impl SessionContext {
// check if the file extension matches the expected extension
for path in &table_paths {
let file_name = path.prefix().filename().unwrap_or_default();
if !path.as_str().ends_with(&option_extension) && file_name.contains('.') {
if !file_name.ends_with(&option_extension) && file_name.contains('.') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check is just ill-formed, if the ListingTableUrl is to a directory containing a . this check will reject it. I'm not sure what this check is here for tbh...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !file_name.ends_with(&option_extension) && file_name.contains('.') {
if !file_name.ends_with(&option_extension) && !path.is_collection() {

Perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't compile for me. Perhaps this method isn't available in the version of arrow-rs that we are currently using?

no method named `is_collection` found for reference `&ListingTableUrl` in the current scope

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListingTableUrl is a DataFusion concept, perhaps your checkout is behind main?

return exec_err!(
"File '{file_name}' does not match the expected extension '{option_extension}'"
);
Expand Down