duckdb / duckdb_spatial

MIT License
474 stars 35 forks source link

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

Open keremulutas opened 3 months ago

keremulutas commented 3 months ago

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 commented 3 months ago

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.

rouault commented 3 months ago

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

rouault commented 2 months ago

GDAL 3.9.2 has been released with the fix