You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Aman Sinha <as...@maprtech.com> on 2014/11/12 03:05:57 UTC

Need a PushFilterPastAggregate rule ?

For the following types of queries, we should be able to push the filter
past the aggregate since the filter is on grouping column.

1. select o_custkey from cp.`tpch/orders.parquet` group by o_custkey having
o_custkey < 10;
2. select * from (select o_custkey from cp.`tpch/orders.parquet` group by
o_custkey) where o_custkey < 10;

  FilterRel(condition=[<($0, 10)])
    AggregateRel(group=[{0}])
      ProjectRel(o_custkey=[$1])
        EnumerableTableAccessRel(table=[[cp, tpch/orders.parquet]])


Should I create a JIRA for adding a new PushFilterPastAggregate rule ?  I
can work on it.

Aman

Re: Need a PushFilterPastAggregate rule ?

Posted by Aman Sinha <as...@maprtech.com>.
I see.... that's good to know !  Yes, we need to upgrade in the near
future...

On Tue, Nov 11, 2014 at 9:44 PM, Julian Hyde <ju...@hydromatic.net> wrote:

> It's already there. You guys just need to upgrade. :)
>
> In 0.9.2, it's called PushFilterPastAggregateRule.
> In 1.0, it has been renamed to FilterAggregateTransposeRule.
>
> On Tue, Nov 11, 2014 at 6:05 PM, Aman Sinha <as...@maprtech.com> wrote:
> > For the following types of queries, we should be able to push the filter
> > past the aggregate since the filter is on grouping column.
> >
> > 1. select o_custkey from cp.`tpch/orders.parquet` group by o_custkey
> having
> > o_custkey < 10;
> > 2. select * from (select o_custkey from cp.`tpch/orders.parquet` group by
> > o_custkey) where o_custkey < 10;
> >
> >   FilterRel(condition=[<($0, 10)])
> >     AggregateRel(group=[{0}])
> >       ProjectRel(o_custkey=[$1])
> >         EnumerableTableAccessRel(table=[[cp, tpch/orders.parquet]])
> >
> >
> > Should I create a JIRA for adding a new PushFilterPastAggregate rule ?  I
> > can work on it.
> >
> > Aman
>

Re: Need a PushFilterPastAggregate rule ?

Posted by Julian Hyde <ju...@hydromatic.net>.
It's already there. You guys just need to upgrade. :)

In 0.9.2, it's called PushFilterPastAggregateRule.
In 1.0, it has been renamed to FilterAggregateTransposeRule.

On Tue, Nov 11, 2014 at 6:05 PM, Aman Sinha <as...@maprtech.com> wrote:
> For the following types of queries, we should be able to push the filter
> past the aggregate since the filter is on grouping column.
>
> 1. select o_custkey from cp.`tpch/orders.parquet` group by o_custkey having
> o_custkey < 10;
> 2. select * from (select o_custkey from cp.`tpch/orders.parquet` group by
> o_custkey) where o_custkey < 10;
>
>   FilterRel(condition=[<($0, 10)])
>     AggregateRel(group=[{0}])
>       ProjectRel(o_custkey=[$1])
>         EnumerableTableAccessRel(table=[[cp, tpch/orders.parquet]])
>
>
> Should I create a JIRA for adding a new PushFilterPastAggregate rule ?  I
> can work on it.
>
> Aman