Skip to content

list(struct_col) produces just the first value duplicated for an UNBOUNDED PRECEDING window  #12136

@cmdlineluser

Description

@cmdlineluser

What happens?

This works as expected with a non-struct column:

import duckdb

duckdb.sql("""
from (values ('A'), ('B'), ('C'))
select
   list(col0) over (rows between unbounded preceding and current row) as result
""")

# ┌───────────┐
# │  result   │
# │ varchar[] │
# ├───────────┤
# │ [A]       │
# │ [A, B]    │
# │ [A, B, C] │
# └───────────┘

But with a struct column it appears to only produce lists containing the first value.

To Reproduce

import duckdb

duckdb.sql("""
from (values ({'key': 'A'}), ({'key': 'B'}), ({'key': 'C'}))
select
   list(col0) over (rows between unbounded preceding and current row) as result
""")

# ┌──────────────────────────────────────┐
# │                result                │
# │       struct("key" varchar)[]        │
# ├──────────────────────────────────────┤
# │ [{'key': A}]                         │
# │ [{'key': A}, {'key': A}]             │
# │ [{'key': A}, {'key': A}, {'key': A}] │
# └──────────────────────────────────────┘

OS:

macOS-13.6.1-arm64-arm-64bit

DuckDB Version:

0.10.3-dev1278

DuckDB Client:

Python

Full Name:

Karl Genockey

Affiliation:

None

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions