Multi-array `UNNEST` fails with an internal error
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 73
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 129
Description
On Doltgres 1.3.2, single-array `UNNEST` works, but the multi-array form fails.
### Repro
```sql
SELECT *
FROM unnest(
ARRAY[1, 2]::integer[],
ARRAY[3, 4]::integer[]
);
```
Fails with:
```text
ERROR: function unnest(integer[], integer[]) does not exist
SQLSTATE: 42883
```
The bulk-insert form:
```sql
CREATE TABLE bulk_example (
id integer PRIMARY KEY,
label text
);
INSERT INTO bulk_example (id, label)
SELECT *
FROM unnest(
ARRAY[1, 2]::integer[],
ARRAY['a', 'b']::text[]
);
```
Also fails with:
```text
ERROR: number of values does not match number of columns provided
SQLSTATE: 42601
```
Contributor guide
Research direction
Start by running the two SQL reproductions in the issue and trace the UNNEST entry point for multi-array calls. Locate the handling for multi-array UNNEST and add or update coverage so both the SELECT form and the bulk INSERT form succeed with the shown array inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100