apache / apache/datafusion

File 'supplier.parquet' does not match the expected extension '.parquet'

Open
#8,264 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Describe the bug

I am testing Ballista with DataFusion 33 and getting this confusing error:

```
File 'supplier.parquet' does not match the expected extension '.parquet'
```

I am pretty sure that `supplier.parquet` does end with `.parquet`.

Here is the code that produces this error message:

```rust
let file_name = path.prefix().filename().unwrap_or_default();
if !path.as_str().ends_with(&option_extension) && file_name.contains('.') {
return exec_err!(
"File '{file_name}' does not match the expected extension '{option_extension}'"
);
}
```

The code checks to see if `path.as_str()` ends with the extension, but the error message shows `file_name` instead of `path.as_str()`, so this seems to be misleading. I think it would be better to also show the value of `path.as_str()` in the error message to make this easier to debug.

I also wonder whether it is intentional that we are checking `path.as_str()` rather than `file_name`?

### To Reproduce

This is not easy to reproduce via Ballista.

### Expected behavior

I expect the error message to give me all of the context necessary so that I can debug the issue (which may well be due to a Ballista bug in this case).

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the extension check shown in the issue, especially the difference between path.as_str() and file_name. Confirm which value should be checked and reported, then verify that the resulting error contains enough path context and does not falsely reject supplier.parquet.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.