You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Volodymyr Vysotskyi (JIRA)" <ji...@apache.org> on 2018/08/27 21:27:00 UTC

[jira] [Comment Edited] (CALCITE-2470) RelBuilder.project should combine expressions if underlying node is a Project

    [ https://issues.apache.org/jira/browse/CALCITE-2470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594236#comment-16594236 ] 

Volodymyr Vysotskyi edited comment on CALCITE-2470 at 8/27/18 9:26 PM:
-----------------------------------------------------------------------

It would be good to add an ability somehow to disable this feature for downstream projects. For example, add one more property to the {{RelBuilder}} class, or use a method to detect that merging is allowed, so the underlying project can override it in custom {{RelBuilder}}.


was (Author: vvysotskyi):
It would be good to add an ability somehow to disable this feature for downstream projects. For example, add one more property to the {{RelBuilder}} class, or use a method to detect that merging is allowed, so the underlying method can override it.

> RelBuilder.project should combine expressions if underlying node is a Project
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-2470
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2470
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.18.0
>
>
> The {{RelBuilder.project}} method should combine expressions if underlying node is a {{Project}}.
> For example, if {{r}} is a {{RelBuilder}} and its stack initially contains
> {code:java}
> Project(Scan(T), a, b, a + b as c){code}
> and we call (in pseudo-code)
> {code:java}
> r.project(a + c as d){code}
> then the result should be
> {code:java}
> Project(Scan(T), a + (a + b) as d){code}
> Today the result is
> {code:java}
> Project(Project(Scan(T), a, a + b as c), a + c as d){code}
> In some circumstances the result will be larger (i.e. contain more {{RexNode}} instances) but much more frequently the result will be smaller and simpler.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)