Class AggregateJoinRemoveRule


  • public class AggregateJoinRemoveRule
    extends RelOptRule
    Planner rule that matches an Aggregate on a Join and removes the join provided that the join is a left join or right join and it computes no aggregate functions or all the aggregate calls have distinct.

    For instance,

    select distinct s.product_id from
     sales as s
     left join product as p
     on s.product_id = p.product_id

    becomes

    select distinct s.product_id from sales as s