Skip to content

Redundant aggregation elimination regression #17138

@findepi

Description

@findepi

This passes in DataFusion 49.0.0

statement ok
CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER)

statement ok
INSERT INTO tab1 VALUES(51,14,96)

statement ok
INSERT INTO tab1 VALUES(85,5,59)

statement ok
INSERT INTO tab1 VALUES(91,47,68)

query R
SELECT + CAST ( NULL AS INTEGER ) * + + AVG ( DISTINCT 4 ) + - SUM ( ALL + col1 ) AS col0
FROM tab1
----
NULL

the query fails on current main

1. query failed: DataFusion error: Execution error: avg(DISTINCT) aggregations are not available
[SQL] SELECT + CAST ( NULL AS INTEGER ) * + + AVG ( DISTINCT 4 ) + - SUM ( ALL + col1 ) AS col0
FROM tab1

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionSomething that used to work no longer does

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions