You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tajo.apache.org by Atri Sharma <at...@gmail.com> on 2015/05/06 08:13:12 UTC
PreLogicalPlanVerifier structure
Hi All,
I am understanding PreLogicalPlanVerifier for implementing TAJO-572. I see
that it is structures in visit functions. I am not sure how the execution
flow is handled for this class.
Can someone elaborate a bit please?
--
Regards,
Atri
*l'apprenant*
Re: PreLogicalPlanVerifier structure
Posted by Atri Sharma <at...@gmail.com>.
Thanks.
So understanding deeper, I understand we will need to add to visitGroupBy
in LogicalPlanVerifier and ensure that the expressions match up?
On Thu, May 7, 2015 at 1:22 AM, Hyunsik Choi <hy...@apache.org> wrote:
> Hi Atri,
>
> In order to understand PreLogicalPlanVerifier, you firstly need to see
> BaseAlgebraVisitor class, which contains default walkers on Expr
> structure.
>
> Also, the key function is BaseAlgebraVisitor::visit, visiting each
> node according to a node type. After deciding, BaseAlgebraVisitor
> invokes one of the default walkers implemented in BaseAlgebraVisitor.
> BaseAlgebraVisitor::visitProjection, BaseAlgebraVisitor::visitFilter,
> and so on are all default walkers. Each default walker tries to invoke
> BaseAlgebraVisitor::visit method against its child nodes.
> BaseAlgebraVisitor::visit against decides the node type of a visiting
> node against. This process will be done recursively.
>
> PreLogicalPlanVerifier class uses BaseAlgebraVisitor::visit and
> default walkers as well as some override functions. Actually, most of
> visitors in Tajo were designed by this concept.
>
>
> In addition, there are a couple of verifiers. PreLogicalPlanVerifier
> aims at validating very simple ones that do not requires much
> information. In contrast, LogicalPlanVerifier is designed to verify
> fully annotated plans. I think that TAJO-572 may need
> LogicalPlanVerifier instead of PreLogicalPlanVerifier because TAJO-572
> should determine whether some function is aggregation or not.
>
> Also, TAJO-572 also needs to determine if some expression in GROUP BY
> clause is derived from one expression in select list. For example:
>
> SELECT concat(x, y) as z, SUM(k), AVG(l) FROM GROUP BY z;
>
> PreLogicalPlanVerifier cannot handle much information, so in my
> opinion LogicalPlanVerifier would be proper to TAJO-572.
>
> Best regards,
> Hyunsik
>
>
> On Tue, May 5, 2015 at 11:13 PM, Atri Sharma <at...@gmail.com> wrote:
> > Hi All,
> >
> > I am understanding PreLogicalPlanVerifier for implementing TAJO-572. I
> see
> > that it is structures in visit functions. I am not sure how the execution
> > flow is handled for this class.
> >
> > Can someone elaborate a bit please?
> >
> > --
> > Regards,
> >
> > Atri
> > *l'apprenant*
>
--
Regards,
Atri
*l'apprenant*
Re: PreLogicalPlanVerifier structure
Posted by Hyunsik Choi <hy...@apache.org>.
Hi Atri,
In order to understand PreLogicalPlanVerifier, you firstly need to see
BaseAlgebraVisitor class, which contains default walkers on Expr
structure.
Also, the key function is BaseAlgebraVisitor::visit, visiting each
node according to a node type. After deciding, BaseAlgebraVisitor
invokes one of the default walkers implemented in BaseAlgebraVisitor.
BaseAlgebraVisitor::visitProjection, BaseAlgebraVisitor::visitFilter,
and so on are all default walkers. Each default walker tries to invoke
BaseAlgebraVisitor::visit method against its child nodes.
BaseAlgebraVisitor::visit against decides the node type of a visiting
node against. This process will be done recursively.
PreLogicalPlanVerifier class uses BaseAlgebraVisitor::visit and
default walkers as well as some override functions. Actually, most of
visitors in Tajo were designed by this concept.
In addition, there are a couple of verifiers. PreLogicalPlanVerifier
aims at validating very simple ones that do not requires much
information. In contrast, LogicalPlanVerifier is designed to verify
fully annotated plans. I think that TAJO-572 may need
LogicalPlanVerifier instead of PreLogicalPlanVerifier because TAJO-572
should determine whether some function is aggregation or not.
Also, TAJO-572 also needs to determine if some expression in GROUP BY
clause is derived from one expression in select list. For example:
SELECT concat(x, y) as z, SUM(k), AVG(l) FROM GROUP BY z;
PreLogicalPlanVerifier cannot handle much information, so in my
opinion LogicalPlanVerifier would be proper to TAJO-572.
Best regards,
Hyunsik
On Tue, May 5, 2015 at 11:13 PM, Atri Sharma <at...@gmail.com> wrote:
> Hi All,
>
> I am understanding PreLogicalPlanVerifier for implementing TAJO-572. I see
> that it is structures in visit functions. I am not sure how the execution
> flow is handled for this class.
>
> Can someone elaborate a bit please?
>
> --
> Regards,
>
> Atri
> *l'apprenant*