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

Support arrays with a fixed length #602

Open
JelteF opened this issue Feb 14, 2025 · 0 comments
Open

Support arrays with a fixed length #602

JelteF opened this issue Feb 14, 2025 · 0 comments
Labels
types Issues related to type conversions

Comments

@JelteF
Copy link
Collaborator

JelteF commented Feb 14, 2025

Description

DuckDB allows arrays to have a fixed length. But returning those from a query currently throws an error that we don't support the type.

select * from duckdb.query($$ select [1, 2]::int[2] $$);
WARNING:  01000: (PGDuckDB/GetPostgresDuckDBType) Could not convert DuckDB type: INTEGER[2] to Postgres type
LOCATION:  GetPostgresDuckDBType, pgduckdb_types.cpp:1098
ERROR:  XX000: (PGDuckDB/CreatePlan) Cache lookup failed for type 0
LOCATION:  CreatePlan, pgduckdb_planner.cpp:76

It should be pretty simple to support these by simply converting them to a postgres array type (without a specified length). i.e. convert INTEGER[2] to INTEGER[] automatically.

Once we do this we should be able to un-exclude a bunch of these lines:

fixed_varchar_array,
fixed_nested_int_array,
fixed_nested_varchar_array,
fixed_struct_array,
struct_of_fixed_array,
fixed_array_of_int_list,
list_of_fixed_int_array,

@JelteF JelteF added the types Issues related to type conversions label Feb 14, 2025
@wuputah wuputah changed the title Support arrays with a fixed lenght Support arrays with a fixed length Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Issues related to type conversions
Projects
None yet
Development

No branches or pull requests

1 participant