Hi Renjie:

   Trait acts as a mark or tip to explain the properties of its relnode.
Every relnode will have some traits (or properties like the relnode needs
to  be randomly  distributed or single node execution  ).
    The TraitDef is a definition of the trait , gives you a chance to do
some work to your relnode which holds the corresponding trait.

     One relnode will be wrapped as a AbstractConverter when added to the
VolcanoPlanner but not have expected traits. The planner will leverage this
class as a phase to do the conversion according to the traitdef  to
transform the input relnode to a fresh one with the expected trait.

    Normally the initial created relnodes doesn't have our expected
trait,then we will add our trait to the relnode ,the planner will do the
transform operation .

On Wed, 9 Aug 2017 at 5:02 PM Renjie Liu <liurenjie2...@gmail.com> wrote:

> Hi, all:
> I'm reading calcite's source code and confused with these two classes. Why
> these two classes exists and what's their role in query optimizer process?
> --
> Liu, Renjie
> Software Engineer, MVAD

Reply via email to