Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL Error if types is not provided #50

Open
carlopi opened this issue Oct 8, 2024 · 1 comment
Open

INTERNAL Error if types is not provided #50

carlopi opened this issue Oct 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@carlopi
Copy link

carlopi commented Oct 8, 2024

Hi and thanks for sending the extension trough. I was curious and trying this out, but I bumped in this, and though of reporting it:

LOAD sheetreader;
FROM sheetreader('path/to/test.xlsx');

Returns for me:

INTERNAL Error: Failed to bind "sheetreader": 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

It seems that providing types is all it's needed to solve the problem:

LOAD sheetreader;
FROM sheetreader('path/to/test.xlsx', types=[BOOLEAN,VARCHAR]);

Unsure whether this needs actual solving or just forcing parameter to be provided.
File was generated like:

LOAD spatial;
COPY (SELECT 1337 as i, 'foobar' as f) TO '__TEST_DIR__/test.xlsx' WITH (FORMAT GDAL, DRIVER 'xlsx');
@freddie-freeloader
Copy link
Contributor

Hey @carlopi,

Thank you for the report.

I will look into this -- I think the issue is, that the normal logic for determining the column types needs at least two rows -- this heuristic is not used, when you provide the types.

I'll add a more graceful handling for these one row cases 👍

@freddie-freeloader freddie-freeloader self-assigned this Oct 8, 2024
@freddie-freeloader freddie-freeloader added the bug Something isn't working label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants