calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: Calcite returning multiple operator trees
Date Mon, 10 Aug 2015 21:29:01 GMT
There isn’t an interface as such. But you could modify the code to achieve that behavior.

All of the various plans are held in the graph of the VolcanoPlanner consisting of RelSet,
RelSubset and RelNode objects.  RelSubset.CheapestPlanReplacer walks over that graph finding
the cheapest. It uses the RelSubset.best field but you could create a similar class that 
return all plans within K of the best cost.

A few words of caution. Each path through the graph is another plan, and there is a huge number
of combinations, and many of the combinations will be very similar to each other. You should
keep the threshold small, and filter out plans that are not very different.

Julian


> On Aug 7, 2015, at 11:42 PM, Raajay <raajay.v@gmail.com> wrote:
> 
> Hello,
> 
> I am just starting to explore Calcite, especially related to its
> application to Hive. As I understand it, Calcite takes as input the
> following:
> 
> 1. An SQL operator tree
> 2. A set of rules (pattern based) that define alterations to the three
> 3. A cost model for basic operations.
> 
> 
> Given these, calcite explores the space of all possible alterations (based
> on the rules) and returns the one with least cost. Is there an interface
> for Calcite to return multiple Operator trees, say for example, all trees
> with cost below a threshold ?
> 
> If yes, pointers to it would be great.
> 
> Thanks
> Raajay


Mime
View raw message