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

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

Closed
2 tasks done
cmdlineluser opened this issue May 20, 2024 · 0 comments · Fixed by #12150
Closed
2 tasks done

Comments

@cmdlineluser
Copy link
Contributor

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
hawkfish added a commit to hawkfish/duckdb that referenced this issue May 21, 2024
Fix single-lvaue slicing of aggregate STRUCT arguments

fixes: duckdb#12136
fixes: duckdblabs/duckdb-internal#2089
Mytherin added a commit that referenced this issue May 21, 2024
hawkfish added a commit to hawkfish/duckdb that referenced this issue May 26, 2024
Fix single-lvaue slicing of aggregate STRUCT arguments

fixes: duckdb#12136
fixes: duckdblabs/duckdb-internal#2089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants