Querying Excel file fails with 'Failed to bind "ST_Read": Table function must return at least one column'
When I try to query an excel file having 1 sheet with name 'İstatistik' (notice the unicode character, https://www.compart.com/en/unicode/U+0130) - I am getting the following error:
INTERNAL Error: Failed to bind "ST_Read": Table function must return at least one column
This error signals an assertion failure within DuckDB. This usually occurs due to unexpected conditions or errors in the program's logic.
For more information, see https://duckdb.org/docs/dev/internal_errors
I added the file I'm trying to query, file.xlsx file.xlsx
To reproduce:
duckdb -s "INSTALL spatial; LOAD spatial; SELECT * FROM st_read('file.xlsx');"
I also tried specifying the layer name with encoding the character like this, but no luck:
layer = "\u0130statistik"
DuckDB version: v1.0.0 1f98600c2c OS: MacOS Ventura 13.5.1
I also suspect the reason might be some kind of old version Excel file, but I couldn't verify as I don't have Microsoft Excel installed on my machine. However, when I import the file to Google Docs Spreadsheets and then download as .xlsm, it can be queried with having the same sheet name.
GDAL upstream issue that will be fixed per https://github.com/OSGeo/gdal/pull/10453
GDAL 3.9.2 has been released with the fix
Hello!
As of DuckDB 1.2.0 the duckdb excel extension provides support for reading and writing xlsx files with greater efficiency and many more options. Therefore we're going to deprecate this feature in the spatial extension in the future. I would recommend that you try out the excel extension, and if you run into any problems please open an issue over at the duckdb-excel repository.