trilogy-data / trilogy-data/pytrilogy
Hidden Unnest on DUckDB changes output
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 61
- Forks
- 3
- Avg merge
- 7h 18m
- Merged PRs (30d)
- 43
Description
Description
Duckdb can do inline unnesting
eg
select 1, unnest([1,2,3])
which will output 3 rows.
Expected Behaviour
When a column that is an unnest is hidden in the select, the expectation is that the output row cardinality is the same as if it is not hidden.
Actual Behaviour
Since the unnest is inlined in the select and not rendered, the cardinality result is as if the unnest was not there.
PreQL Code
The code that produces the error.
Affected Version
Please provide the version number where this issue was encountered.
Steps to Reproduce
- First step
- Second step
- etc.
Checklist
- I have verified this does not duplicate an existing issue
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the DuckDB-style query select 1, unnest([1,2,3]) and trace how hidden select columns are handled. Identify the unnest planning or rendering entry point and compare row cardinality when the unnest is visible versus hidden. Done means the hidden unnest preserves the expected three-row result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100