Skip to content

Aggregate filters do not get pushed down to table scan #3546

@andygrove

Description

@andygrove

Describe the bug
Aggregate filters do not get pushed down to table scan. This results in invalid query plans. In this example, the column user_id has not been pushed down to the table scan.

Projection: #SUM(user_table_1.b) FILTER (WHERE #user_id = Int64(2)) AS S1, #SUM(user_table_1.b) AS S2
  Aggregate: groupBy=[[]], aggr=[[SUM(#user_table_1.b) FILTER (WHERE #user_id = Int64(2)), SUM(#user_table_1.b)]]
    TableScan: user_table_1 projection=[b]

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingoptimizerOptimizer rules

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions