You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Michael Alexeev <mi...@gmail.com> on 2017/09/07 00:48:42 UTC

Re: JoinPushTransitivePredicatesRule

I kind of narrowed down the problem. The RelNode that represents the join
is my own class that extends the Calcite's Join class. The predicateHandler
from the  RelMetadataQuery.getPulledUpPredicates throws
the JaninoRelMetadataProvider.NoHandler exception from
the predicateHandler.getPredicates method when my join node is passed as an
argument.

I guess I have to provide my own implementation of the RelMetadataProvider
that can handle the Calcite's RelNode classes plus my own and somehow
register it with the JaninoRelMetadataProvider.

Is this more or less accurate?

If so, is there an example how to implement a custom provider?

Any help is greatly appreciated,
Mike

On Thu, Aug 31, 2017 at 7:06 AM, Michael Alexeev <mi...@gmail.com>
wrote:

> Hi Gautam,
>
> Yes, in case of your query I do the see the filter T2.C2 > 0 being pushed
> down to the T2 scan. But this happens even with or without the
> JoinPushTransitivePredicatesRule.
>
> Mike
>
>
> On Wed, Aug 30, 2017 at 9:39 PM, Gautam Parai <gp...@mapr.com> wrote:
>
>> Hi Michael,
>>
>>
>> Do you see a filter pushdown with the following query?
>>
>> select * from T1 inner join T2 on T1.C = T2.C1 where T2.C2 > 0;
>>
>>
>> Gautam
>>
>> ________________________________
>> From: Michael Alexeev <mi...@gmail.com>
>> Sent: Wednesday, August 30, 2017 5:58:04 PM
>> To: dev@calcite.apache.org
>> Subject: JoinPushTransitivePredicatesRule
>>
>> Hi All,
>>
>> Consider a query
>>
>> select * from T1 inner join T2 on T1.C = T2.C1 and T2.C2 > 0;
>>
>> I would expect that the JoinPushTransitivePredicatesRule would push the
>> T2.C2
>> > 0 expression as a filter down to the inner scan over the T2 table,
>> right?
>>
>> But, for whatever reason, the inferred RelOptPredicateList
>> <https://calcite.apache.org/apidocs/org/apache/calcite/plan/
>> RelOptPredicateList.html>
>> has
>> both left and right predicate lists empty inside
>> JoinPushTransitivePredicatesRule.onMatch call thus the whole original ON
>> expression stays at the join node.
>>
>> Is my expectation wrong? If so, is there a way to push inner/outer filters
>> to corresponding join nodes?
>>
>> Thanks,
>> Mike
>>
>
>