You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "He, Guanlin" <gb...@psu.edu> on 2024/09/23 17:02:58 UTC
Question regarding calcite logical algebra's ordinal place holder
Hi developers of calcite.
I am wondering if there is a way to change the ordinal in RelNode's relational algebra into the field name.
For example if I have logical planning like:
LogicalProject(name=[$1])
LogicalJoin(condition=[=($0, $6)], joinType=[inner])
How could I change back into: and only output logcal algebra string.
LogicalProject(name=[student.name])
LogicalJoin(condition=[=(student.id, section.id)], joinType=[inner])
I am currently iterating through relNode and fill exps by their rowType but this method is really mess and need alot of pre condition ( for example, case join and case agg). I am wondering if there is a easy way that I dont know could do that.
Best,
Guanllin He
Re: Question regarding calcite logical algebra's ordinal place holder
Posted by Julian Hyde <jh...@gmail.com>.
Are you interested in changing (1) how field references are represented in RelNodes, (2) how field references are printed in plans, (3) how references to fields are created when you are building a tree of RelNodes.
(1) would be a huge disruptive change (and require us to decide what to do when field names are not unique); (2) is straightforward - you can write your own printer; (3) is already solved by RelBuilder.
Julian
PS Your message went through moderation. You should subscribe to the dev@ list in so that you receive timely replies, and we are saved the effort of moderation.
> On Sep 23, 2024, at 10:02 AM, He, Guanlin <gb...@psu.edu> wrote:
>
> Hi developers of calcite.
>
> I am wondering if there is a way to change the ordinal in RelNode's relational algebra into the field name.
>
> For example if I have logical planning like:
> LogicalProject(name=[$1])
> LogicalJoin(condition=[=($0, $6)], joinType=[inner])
>
> How could I change back into: and only output logcal algebra string.
>
> LogicalProject(name=[student.name])
> LogicalJoin(condition=[=(student.id, section.id)], joinType=[inner])
>
> I am currently iterating through relNode and fill exps by their rowType but this method is really mess and need alot of pre condition ( for example, case join and case agg). I am wondering if there is a easy way that I dont know could do that.
>
> Best,
> Guanllin He
>
>
>
Re: Question regarding calcite logical algebra's ordinal place holder
Posted by Mihai Budiu <mb...@gmail.com>.
In general these identifiers can represent either subexpressions of the expressions in the original program, or even new expressions that do not appear in the program (e.g., when stddev is expanded), so there many be no column name associated with an expression.
Mihai
________________________________
From: He, Guanlin <gb...@psu.edu>
Sent: Monday, September 23, 2024 10:02 AM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Question regarding calcite logical algebra's ordinal place holder
Hi developers of calcite.
I am wondering if there is a way to change the ordinal in RelNode's relational algebra into the field name.
For example if I have logical planning like:
LogicalProject(name=[$1])
LogicalJoin(condition=[=($0, $6)], joinType=[inner])
How could I change back into: and only output logcal algebra string.
LogicalProject(name=[student.name])
LogicalJoin(condition=[=(student.id, section.id)], joinType=[inner])
I am currently iterating through relNode and fill exps by their rowType but this method is really mess and need alot of pre condition ( for example, case join and case agg). I am wondering if there is a easy way that I dont know could do that.
Best,
Guanllin He