duckdb_spatial icon indicating copy to clipboard operation
duckdb_spatial copied to clipboard

Querying Excel file fails with 'Failed to bind "ST_Read": Table function must return at least one column'

Open keremulutas opened this issue 1 year ago • 3 comments

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

keremulutas avatar Jul 11 '24 18:07 keremulutas

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.

keremulutas avatar Jul 12 '24 06:07 keremulutas

GDAL upstream issue that will be fixed per https://github.com/OSGeo/gdal/pull/10453

rouault avatar Jul 20 '24 00:07 rouault

GDAL 3.9.2 has been released with the fix

rouault avatar Aug 25 '24 15:08 rouault

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.

Maxxen avatar Feb 05 '25 21:02 Maxxen