Add filename as parameter to read_xlsx
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 62
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
The read_xlsx function does not allow you to add the file name as a column.
This would be useful in cases where data is included in the file name, especially when reading multiple files like this:
file_2025-06.xlsx.
file_2025-07.xlsx
file_2025-08.xlsx.
It would be very useful to have the same functionality as the read_csv function with filename=true, which outputs a filename column.
Example:
https://duckdb.org/docs/stable/data/multiple_files/overview.html
Read the CSV files flights1.csv and flights2.csv, unifying schemas by name and outputting a filename column:
SELECT *, filename
FROM read_csv(['flights1.csv', 'flights2.csv'], union_by_name = true, filename = true);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the read_xlsx entry point and compare its behavior with read_csv when filename=true. Verify how multiple files are handled, then confirm that read_xlsx accepts the requested option and produces a filename column for each input file, as shown in the issue's SQL example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100