Did you look into the Geode and Druide example projects ? They have some
rules that might help.
I remember very well that Apache Calcite does exactly what you say, its
join rule decides which join algorithm will be executed. Check that out.
Here [1] is Michael's answer on SoF that might shed some light on what you
need.

Straight into your question, you need to match exactly what you need, else,
you might end up modifying operators in the plan tree that you didn't want
to touch.
To do that, you need to identify the inputs to your join operator, their
convention and the join operator's convention. All this can be specified in
the rule's constructor super method call.
If you need more control, you can run extra checks in the *matches* method.
Or you can simply abort your rule if it's mistakenly matched by aborting
the execution on *onMatch* method by simply returning.

Forgive me if I'm answer is too general but I would say that your question
isn't very specific itself. Perhaps you can start by sharing your trials so
everyone can have a better idea about what's wrong with your rule.

[1]
https://stackoverflow.com/questions/56234480/whats-the-difference-between-calcites-converterrule-and-reloptrule

Thanks,
Gelbana


On Tue, Jul 9, 2019 at 5:22 PM Felipe Gutierrez <
[email protected]> wrote:

> Hi,
>
> Is there any tutorial teaching how to create my own rule (using Java) in
> apache Calcite?
> I want to create a rule for join operators which I can decide which
> implementation of join I use.
>
> Or, maybe, is there any example that I can see how does it work in Calcite?
>
> thanks
> Felipe
> *--*
> *-- Felipe Gutierrez*
>
> *-- skype: felipe.o.gutierrez*
> *--* *https://felipeogutierrez.blogspot.com
> <https://felipeogutierrez.blogspot.com>*
>

Reply via email to