It seems that you just need a new convention which integrated with you custom 
algorithm, you can reference EnumerableJoin [1] for some inspirations.

[1] 
https://github.com/apache/calcite/blob/c6b6800c220e513f1d9a2b167b2f14cb689c0b06/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoin.java#L47

Best,
Danny Chan
在 2019年5月17日 +0800 AM8:38,Valeriy Trofimov <[email protected]>,写道:
> Thank you for the replies. I though that rules are used during query
> planning/optimization stage, not to manipulate real data returned after
> executing the query. What I want to do is to use a custom algorithm to join
> data returned from the left and right side of the query after the query is
> executed. So, in my case it would probably be writing a rule that says "if
> you see keyword JOIN, then change the query to not do the join, but to get
> me data from left and right sides and then do the join using my own
> algorithm". Let me know if it's possible.
>
> Thanks,
> Val
>
> On Thu, May 16, 2019 at 3:24 PM Parimarjan Negi <[email protected]>
> wrote:
>
> > Hi,
> >
> > I have been working on a research project that tries out various strategies
> > for join algorithms. Here are some implementations of various baselines
> > like exhaustive search, left deep search etc. which may be helpful for you.
> > Here is the implementation for the exhaustive search rule which uses
> > Calcite' implementations (like BushyJoinOrderRule) as a base:
> >
> >
> > https://github.com/parimarjan/query-optimizer/blob/master/src/main/java/ExhaustiveDPJoinOrderRule.java#L40
> >
> > Best,
> > Pari
> >
> > On Thu, May 16, 2019 at 4:37 PM Ivan Grgurina <[email protected]>
> > wrote:
> >
> > > What do you mean by "custom join algorithm"? You seem to be mixing "SQL
> > > join queries" with "Avatica". Calcite uses planner rules on relational
> > > algebra level, you can write a rule that transforms Join RelNode with
> > your
> > > algorithm. Is that what you want to do?
> > >
> > > ig
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: Valeriy Trofimov <[email protected]>
> > > Sent: Thursday, May 16, 2019 9:47 PM
> > > To: [email protected]
> > > Subject: Customizing Join Algorithm
> > >
> > > Hi All,
> > >
> > > I want to use a custom join algorithm in Calcite SQL join queries. My
> > > questions are:
> > >
> > > 1. Is it possible to do?
> > > 2. If yes, what part of Calcite should I update?
> > >
> > > I've tried to figure it out myself by debugging Calcite join unit tests,
> > > but it looks like Calcite uses Avatica for this.
> > >
> > > Thanks,
> > > Val
> > >
> >

Reply via email to