Binder Error when sheet name includes some special characters
- Dominant language
- C++
- Stars
- 62
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Including some special characters (below) in a sheet name results in a Binder Error when specifying them in the `sheet` parameter to `read_xlsx`.
## Details
Some characters are converted to their HTML entities when finding their corresponding sheet in the Excel file.
The following characters are replaced with their HTML entities when specified in the `sheet` parameter of `read_xlsx`:
- Less-than, `<` -> replaced with `<`
- Greater-than, `>` -> replaced with `>`
- Double-quote, `"` -> replaced with `"`
- Ampersand, `&` -> replaced with `&`
## Example
For an example, create an Excel file with a sheet name like `<---Raw Data`.
Try to read the file with `read_xlsx`:
```sql
from read_xlsx('file.xlsx', sheet='<---Raw Data')
```
This returns a Binder Error:
> Binder Error: Sheet "\<---Raw Data" not found in xlsx file "/path/to/file.xlsx"
Did you mean: "<---Raw Data"
Note that the recommended sheet name is the specified sheet name, just without the HTML entity replacement.
## Version/system details
- DuckDB version: `DuckDB v1.5.3 (Variegata)`
- OS: `macOS Tahoe 26.2 (25C56) `
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with an Excel file whose sheet is named <---Raw Data, then call read_xlsx with that exact sheet name. Trace the sheet-name lookup and HTML-entity handling in the extension, and find the existing read_xlsx test coverage. Done means special characters resolve to the actual sheet name without a Binder Error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100