Just open it in the SqlToRelConverter [1]

[1] 
https://github.com/apache/calcite/blob/3cbbafa941128dc5097c2a26711f5751f764e12d/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L5692

Best,
Danny Chan
在 2019年10月16日 +0800 AM12:23,Rommel Quintanilla <rom...@blazingdb.com>,写道:
> Hi Stamatis, thank you for your attention and actually many thanks to 
> everyone who is seeing/commenting about this topic.
>
> To be honest I didn't know about the existence of RelFieldTrimmer.
>
> I would like to test this, how could I use RelFieldTrimmer? can you give me a 
> suggestion, please?
>
> On 2019/10/12 07:00:00, Stamatis Zampetakis <zabe...@gmail.com> wrote:
> > Hi Rommel,
> >
> > I was hoping that this could be done at least by RelFieldTrimmer [1]. Are
> > you using it already?
> >
> > Best,
> > Stamatis
> >
> > [1]
> > https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
> >
> > On Sat, Oct 12, 2019 at 6:06 AM XING JIN <jinxing.co...@gmail.com> wrote:
> >
> > > Filed a JIRA:
> > > https://issues.apache.org/jira/browse/CALCITE-3405
> > >
> > > Haisheng Yuan <h.y...@alibaba-inc.com> 于2019年10月12日周六 上午4:34写道:
> > >
> > > > Yes, definitely.
> > > >
> > > > You can go through the project expression with InputFinder to find all
> > > the
> > > > used columns, create a logical project with those columns, and remap the
> > > > top project with new column indexes.
> > > >
> > > > On the other hand, instead of creating a new intermidiate pogical
> > > project,
> > > > we can also update ProjectTableScanRule to accept LogicalProject that is
> > > > not a simple mapping, and do the same task I mentioned above.
> > > >
> > > > - Haisheng
> > > >
> > > > ------------------------------------------------------------------
> > > > 发件人:Rommel Quintanilla<rom...@blazingdb.com>
> > > > 日 期:2019年10月12日 03:15:31
> > > > 收件人:<dev@calcite.apache.org>
> > > > 主 题:[QUESTION] Pushing up evaluations from LogicalProjects
> > > >
> > > > Hi, maybe you can help me.
> > > > I have this portion from a larger logical plan:
> > > > ..
> > > > LogicalProject(l_orderkey=[$0], l_suppkey=[$2], *=[*($5, -(1,
> > > > $6))])
> > > > LogicalTableScan(table=[[main, lineitem]])
> > > > ..
> > > >
> > > > Because the LogicalProject above contains an evaluation, the
> > > > ProjectTableScanRule can't convert it to a BindableTableScan.
> > > >
> > > > I wonder if somehow the evaluation could be pushed up more or less like
> > > > this:
> > > > ..
> > > > LogicalProject(l_orderkey=[$0], l_suppkey=[$1], *=[*($2, -(1, $3))])
> > > > LogicalProject(l_orderkey=[$0], l_suppkey=[$2], l_extendedprice=[$5],
> > > > l_discount=[$6]])
> > > > LogicalTableScan(table=[[main, lineitem]])
> > > > ..
> > > >
> > > > Regards.
> > > >
> > >
> >

Reply via email to