Please let us know what solution you end up with.
> On Jan 31, 2017, at 8:45 AM, Renaud Delbru <[email protected]> wrote:
>
> Hi Julian,
>
> Thanks for the quick reply,
> I'll investigate the different approach but I think the third option would
> be the most extensible (in case I need other rules with similar
> requirement).
>
>
> On Tue, Jan 31, 2017 at 5:41 PM, Julian Hyde <[email protected]> wrote:
>
>> If the root is the only place it can match you could almost apply the rule
>> manually (well, you’d have to write your own implementation of
>> RelOptRuleCall).
>>
>> You could customize HepPlanner so that it doesn’t look below the root node.
>>
>> Or, you could invent a new RelNode type (a concrete sub-class of SingleRel
>> would probably do the trick) called Marker and place it at the root node.
>> Make your match only if a Marker is on top. Since no other rules match
>> Marker it would remain at the root.
>>
>> Julian
>>
>>
>>> On Jan 31, 2017, at 7:32 AM, Renaud Delbru <[email protected]>
>> wrote:
>>>
>>> Hi,
>>>
>>> In our scenario, we can have a relational expression that is composed of
>> a
>>> single logical table function scan operator (i.e., the logical table
>>> function scan operator if the root of the relational expression). We
>> would
>>> like to be able to differentiate this with scenarios where this operator
>>> appears as a leaf of some other operators. However, I am not able to
>> find a
>>> way to properly express this as a rule, e.g., by restricting a rule to
>>> match only from the root of the relational expression. Or is there
>> another
>>> way to achieve this ?
>>>
>>> Thanks,
>>> Regards
>>>
>>> --
>>> Renaud Delbru
>>
>>
>
>
> --
> *Renaud Delbru* Siren Solutions - CTO
> [email protected] | http://siren.solutions/
> Unit 13 GTC, Mervue Park, Galway, Ireland