Skip to content

Pushown filter through coalesce on join keys of outer/full join #23110

@kaikalur

Description

@kaikalur
select count(distinct part) from 
 (select count(1) c, coalesce(p.part, s.part) as part from supplier full/left/right join part) on p.part=s.part group by 2)
 where part like '%a' and c > 10

We currently do not pushdown the filter (part like '%a%' down) to the scans. But carefully observing the semantics of coalesce, this can be pushdown below join. It currently works for inner join but it should work outer/full join as well.

CC: @feilong-liu

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🆕 Unprioritized

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions