Skip to content

Assertion error on window function with rollup #17621

@WayneChange

Description

@WayneChange

What happens?

The program crashed during the ​​Execute phase​​ due to an ​​assertion failure​​:
INTERNAL Error:
Assertion triggered in file "/data/mysql/duckdb/duckdb/src/execution/expression_executor.cpp" on line 195: FlatVector::Validity(result).CheckAllValid(count)

Actual:

src/execution/expression_executor.cpp:195
void ExpressionExecutor::Execute(const Expression &expr, ExpressionState *state, const SelectionVector *sel,
                                 idx_t count, Vector &result){
....
D_ASSERT(FlatVector::Validity(result).CheckAllValid(count));
....
}

To Reproduce

CREATE TABLE t(i INT, j INT, k INT);
INSERT INTO t VALUES (1,1,1);
INSERT INTO t VALUES (1,4,1);
INSERT INTO t VALUES (1,2,1);
INSERT INTO t VALUES (1,4,1);
INSERT INTO t VALUES (1,4,1);
INSERT INTO t VALUES (1,1,2);
INSERT INTO t VALUES (1,4,2);
INSERT INTO t VALUES (1,2,2);
INSERT INTO t VALUES (1,4,2);
INSERT INTO t VALUES (1,1,3);
INSERT INTO t VALUES (1,4,3);
INSERT INTO t VALUES (1,2,3);
INSERT INTO t VALUES (1,4,3);
INSERT INTO t VALUES (1,1,4);
INSERT INTO t VALUES (1,4,4);
INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (1,4,4);

SELECT k, STDDEV_POP(i), SUM(j), STDDEV_SAMP(k) OVER (ROWS UNBOUNDED PRECEDING) std_wf FROM t GROUP BY ROLLUP(k);

OS:

centos

DuckDB Version:

v1.3.0

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Wanli Chang

Affiliation:

CDB Team at Tencent

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

I have not tested with any build

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

No - Other reason (please specify in the issue body)

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